mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Check ffmpeg version instead of checking for presence of BTBN_PATH
This commit is contained in:
parent
12d4a47e3d
commit
edb10330ee
@ -7,8 +7,9 @@ import sys
|
||||
import yaml
|
||||
|
||||
sys.path.insert(0, "/opt/frigate")
|
||||
from frigate.const import BIRDSEYE_PIPE, BTBN_PATH # noqa: E402
|
||||
from frigate.const import BIRDSEYE_PIPE # noqa: E402
|
||||
from frigate.ffmpeg_presets import ( # noqa: E402
|
||||
LIBAVFORMAT_VERSION_MAJOR,
|
||||
parse_preset_hardware_acceleration_encode,
|
||||
)
|
||||
|
||||
@ -71,7 +72,7 @@ elif go2rtc_config["rtsp"].get("default_query") is None:
|
||||
go2rtc_config["rtsp"]["default_query"] = "mp4"
|
||||
|
||||
# need to replace ffmpeg command when using ffmpeg4
|
||||
if not os.path.exists(BTBN_PATH):
|
||||
if LIBAVFORMAT_VERSION_MAJOR < 59:
|
||||
if go2rtc_config.get("ffmpeg") is None:
|
||||
go2rtc_config["ffmpeg"] = {
|
||||
"rtsp": "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
|
||||
|
||||
@ -11,7 +11,6 @@ YAML_EXT = (".yaml", ".yml")
|
||||
FRIGATE_LOCALHOST = "http://127.0.0.1:5000"
|
||||
PLUS_ENV_VAR = "PLUS_API_KEY"
|
||||
PLUS_API_HOST = "https://api.frigate.video"
|
||||
BTBN_PATH = "/usr/lib/btbn-ffmpeg"
|
||||
|
||||
# Attributes
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
|
||||
from frigate.const import BTBN_PATH
|
||||
from frigate.util import vainfo_hwaccel
|
||||
from frigate.version import VERSION
|
||||
|
||||
@ -43,7 +43,10 @@ class LibvaGpuSelector:
|
||||
return ""
|
||||
|
||||
|
||||
TIMEOUT_PARAM = "-timeout" if os.path.exists(BTBN_PATH) else "-stimeout"
|
||||
LIBAVFORMAT_VERSION_MAJOR = int(
|
||||
subprocess.getoutput("ffmpeg -version | grep -Po 'libavformat\W+\K\d+'")
|
||||
)
|
||||
TIMEOUT_PARAM = "-timeout" if LIBAVFORMAT_VERSION_MAJOR >= 59 else "-stimeout"
|
||||
|
||||
_gpu_selector = LibvaGpuSelector()
|
||||
_user_agent_args = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user