mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 23:25:25 +03:00
Apply config to go2rtc as well
This commit is contained in:
parent
d3755fd5ed
commit
55d22bdd8c
@ -105,16 +105,34 @@ else:
|
|||||||
**FRIGATE_ENV_VARS
|
**FRIGATE_ENV_VARS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ensure ffmpeg path is set correctly
|
||||||
|
path = config.get("ffmpeg", {}).get("path", "default")
|
||||||
|
if path == "default":
|
||||||
|
if int(os.getenv("LIBAVFORMAT_VERSION_MAJOR", "59")) >= 59:
|
||||||
|
ffmpeg_path = "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
||||||
|
else:
|
||||||
|
ffmpeg_path = "ffmpeg"
|
||||||
|
elif path == "7.0":
|
||||||
|
ffmpeg_path = "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
||||||
|
elif path == "5.0":
|
||||||
|
ffmpeg_path = "/usr/lib/ffmpeg/5.0/bin/ffmpeg"
|
||||||
|
else:
|
||||||
|
ffmpeg_path = f"{path}/bin/ffmpeg"
|
||||||
|
|
||||||
|
if go2rtc_config.get("ffmpeg") is None:
|
||||||
|
go2rtc_config["ffmpeg"] = {"path": ffmpeg_path}
|
||||||
|
elif go2rtc_config["ffmpeg"].get("path") is None:
|
||||||
|
go2rtc_config["ffmpeg"]["path"] = ffmpeg_path
|
||||||
|
|
||||||
# need to replace ffmpeg command when using ffmpeg4
|
# need to replace ffmpeg command when using ffmpeg4
|
||||||
if int(os.environ["LIBAVFORMAT_VERSION_MAJOR"]) < 59:
|
if int(os.environ["LIBAVFORMAT_VERSION_MAJOR"]) < 59:
|
||||||
if go2rtc_config.get("ffmpeg") is None:
|
if go2rtc_config["ffmpeg"].get("rtsp") is None:
|
||||||
go2rtc_config["ffmpeg"] = {
|
|
||||||
"rtsp": "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
|
|
||||||
}
|
|
||||||
elif go2rtc_config["ffmpeg"].get("rtsp") is None:
|
|
||||||
go2rtc_config["ffmpeg"]["rtsp"] = (
|
go2rtc_config["ffmpeg"]["rtsp"] = (
|
||||||
"-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
|
"-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
if go2rtc_config.get("ffmpeg") is None:
|
||||||
|
go2rtc_config["ffmpeg"] = {"path": ""}
|
||||||
|
|
||||||
for name in go2rtc_config.get("streams", {}):
|
for name in go2rtc_config.get("streams", {}):
|
||||||
stream = go2rtc_config["streams"][name]
|
stream = go2rtc_config["streams"][name]
|
||||||
|
|||||||
@ -209,7 +209,9 @@ class RecordingMaintainer(threading.Thread):
|
|||||||
if cache_path in self.end_time_cache:
|
if cache_path in self.end_time_cache:
|
||||||
end_time, duration = self.end_time_cache[cache_path]
|
end_time, duration = self.end_time_cache[cache_path]
|
||||||
else:
|
else:
|
||||||
segment_info = await get_video_properties(cache_path, get_duration=True)
|
segment_info = await get_video_properties(
|
||||||
|
self.config.ffmpeg, cache_path, get_duration=True
|
||||||
|
)
|
||||||
|
|
||||||
if segment_info["duration"]:
|
if segment_info["duration"]:
|
||||||
duration = float(segment_info["duration"])
|
duration = float(segment_info["duration"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user