mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-09 00:17:00 +01:00
Use smarter logic for default ffmpeg handling (#13748)
This commit is contained in:
parent
c17524bc3c
commit
fc145016ea
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ else:
|
|||||||
# ensure ffmpeg path is set correctly
|
# ensure ffmpeg path is set correctly
|
||||||
path = config.get("ffmpeg", {}).get("path", "default")
|
path = config.get("ffmpeg", {}).get("path", "default")
|
||||||
if path == "default":
|
if path == "default":
|
||||||
if int(os.getenv("", "59") or "59") >= 59:
|
if shutil.which("ffmpeg") is None:
|
||||||
ffmpeg_path = "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
ffmpeg_path = "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
||||||
else:
|
else:
|
||||||
ffmpeg_path = "ffmpeg"
|
ffmpeg_path = "ffmpeg"
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
@ -888,7 +889,7 @@ class FfmpegConfig(FrigateBaseModel):
|
|||||||
@property
|
@property
|
||||||
def ffmpeg_path(self) -> str:
|
def ffmpeg_path(self) -> str:
|
||||||
if self.path == "default":
|
if self.path == "default":
|
||||||
if int(os.getenv("LIBAVFORMAT_VERSION_MAJOR", "59")) >= 59:
|
if shutil.which("ffmpeg") is None:
|
||||||
return "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
return "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
||||||
else:
|
else:
|
||||||
return "ffmpeg"
|
return "ffmpeg"
|
||||||
|
Loading…
Reference in New Issue
Block a user