Check ffmpeg version instead of checking for presence of BTBN_PATH (#7023)

* Check ffmpeg version instead of checking for presence of BTBN_PATH

* Query ffmpeg version in s6 run script instead of subprocessing in every import

* Define LIBAVFORMAT_VERSION_MAJOR in devcontainer too

* Formatting

* Default ffmpeg version to current btbn version so unit tests pass
This commit is contained in:
Andrew Reiter
2023-07-06 08:35:26 -04:00
committed by GitHub
parent f30ba25444
commit 325205740b
5 changed files with 13 additions and 5 deletions

View File

@@ -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

View File

@@ -5,7 +5,6 @@ import os
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 +42,11 @@ class LibvaGpuSelector:
return ""
TIMEOUT_PARAM = "-timeout" if os.path.exists(BTBN_PATH) else "-stimeout"
TIMEOUT_PARAM = (
"-timeout"
if int(os.getenv("LIBAVFORMAT_VERSION_MAJOR", "59")) >= 59
else "-stimeout"
)
_gpu_selector = LibvaGpuSelector()
_user_agent_args = [