mirror of
https://github.com/blw1138/Zordon.git
synced 2026-02-05 13:46:10 +00:00
FFMPEG path fixes for ffprobe
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
from src.engines.core.base_engine import *
|
||||
@@ -46,10 +47,19 @@ class FFMPEG(BaseRenderEngine):
|
||||
return version
|
||||
|
||||
def get_project_info(self, project_path, timeout=10):
|
||||
"""Run ffprobe and parse the output as JSON"""
|
||||
try:
|
||||
# Run ffprobe and parse the output as JSON
|
||||
# resolve ffprobe path
|
||||
engine_dir = os.path.dirname(self.engine_path())
|
||||
ffprobe_path = os.path.join(engine_dir, 'ffprobe')
|
||||
if self.engine_path().endswith('.exe'):
|
||||
ffprobe_path += '.exe'
|
||||
if not os.path.exists(ffprobe_path): # fallback to system install (if available)
|
||||
ffprobe_path = 'ffprobe'
|
||||
|
||||
# run ffprobe
|
||||
cmd = [
|
||||
'ffprobe', '-v', 'quiet', '-print_format', 'json',
|
||||
ffprobe_path, '-v', 'quiet', '-print_format', 'json',
|
||||
'-show_streams', '-select_streams', 'v', project_path
|
||||
]
|
||||
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True,
|
||||
@@ -79,7 +89,7 @@ class FFMPEG(BaseRenderEngine):
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
||||
print(f"Failed to get FFMPEG project info: {e}")
|
||||
return None
|
||||
|
||||
def get_encoders(self):
|
||||
|
||||
Reference in New Issue
Block a user