mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-15 19:42:08 +03:00
Log ffmpeg version at startup
Added a utility function to retrieve the ffmpeg version and log it during application startup. This helps with diagnostics and ensures the correct ffmpeg binary is being used.
This commit is contained in:
parent
fd6e7afea9
commit
b1f416c603
@ -75,7 +75,7 @@ from frigate.timeline import TimelineProcessor
|
|||||||
from frigate.track.object_processing import TrackedObjectProcessor
|
from frigate.track.object_processing import TrackedObjectProcessor
|
||||||
from frigate.util.builtin import empty_and_close_queue
|
from frigate.util.builtin import empty_and_close_queue
|
||||||
from frigate.util.image import UntrackedSharedMemory
|
from frigate.util.image import UntrackedSharedMemory
|
||||||
from frigate.util.services import set_file_limit
|
from frigate.util.services import set_file_limit, get_ffmpeg_version
|
||||||
from frigate.version import VERSION
|
from frigate.version import VERSION
|
||||||
from frigate.watchdog import FrigateWatchdog
|
from frigate.watchdog import FrigateWatchdog
|
||||||
|
|
||||||
@ -552,6 +552,10 @@ class FrigateApp:
|
|||||||
self.start_record_cleanup()
|
self.start_record_cleanup()
|
||||||
self.start_watchdog()
|
self.start_watchdog()
|
||||||
|
|
||||||
|
# Log ffmpeg version
|
||||||
|
ffmpeg_version = get_ffmpeg_version(self.config.ffmpeg.ffmpeg_path)
|
||||||
|
logger.info(f"Using ffmpeg: {ffmpeg_version}")
|
||||||
|
|
||||||
self.init_auth()
|
self.init_auth()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -782,6 +782,29 @@ def get_fs_type(path: str) -> str:
|
|||||||
return fsType
|
return fsType
|
||||||
|
|
||||||
|
|
||||||
|
def get_ffmpeg_version(ffmpeg_path: str) -> str:
|
||||||
|
"""Get ffmpeg version."""
|
||||||
|
try:
|
||||||
|
result = sp.run(
|
||||||
|
[ffmpeg_path, "-version"],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
timeout=5
|
||||||
|
)
|
||||||
|
if result.returncode == 0:
|
||||||
|
# Extract version from output (first line contains version info)
|
||||||
|
first_line = result.stdout.split('\n')[0]
|
||||||
|
return first_line.strip()
|
||||||
|
else:
|
||||||
|
return f"Unknown (ffmpeg returned code {result.returncode})"
|
||||||
|
except FileNotFoundError:
|
||||||
|
return f"Not found at path: {ffmpeg_path}"
|
||||||
|
except sp.TimeoutExpired:
|
||||||
|
return "Timeout getting version"
|
||||||
|
except Exception as e:
|
||||||
|
return f"Error: {str(e)}"
|
||||||
|
|
||||||
|
|
||||||
def calculate_shm_requirements(config) -> dict:
|
def calculate_shm_requirements(config) -> dict:
|
||||||
try:
|
try:
|
||||||
storage_stats = shutil.disk_usage("/dev/shm")
|
storage_stats = shutil.disk_usage("/dev/shm")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user