From d1126b7cf6f743039aca87fdc1d7a6cbde11fd8d Mon Sep 17 00:00:00 2001 From: user Date: Sun, 23 Feb 2025 17:58:48 +0300 Subject: [PATCH] final codecs --- converter/converter.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/converter/converter.py b/converter/converter.py index 64c4430..79be559 100644 --- a/converter/converter.py +++ b/converter/converter.py @@ -124,8 +124,6 @@ class MediaDetector: logging.error("Error running ffprobe: %s", e.stderr) sys.exit(1) - - # ============================================================================= # Conversion Strategy Base Class and Implementations # ============================================================================= @@ -148,12 +146,14 @@ class ConversionStrategy: logging.info("Conversion completed successfully.") class VideoHighStrategy(ConversionStrategy): - """High quality video conversion: Apple ProRes (video) + PCM (audio).""" + """High quality video conversion: Lossless H.264 (video) + PCM (audio).""" def convert(self, input_file, output_file): cmd = [ "ffmpeg", "-y", "-i", input_file, - "-c:v", "prores_ks", "-profile:v", "3", - "-c:a", "pcm_s16le" + "-c:v", "libx264", "-preset", "veryslow", "-crf", "18", + "-pix_fmt", "yuv420p", + "-movflags", "+faststart", + "-c:a", "pcm_s16le" # Lossless audio using PCM ] if hasattr(self, "custom_params"): cmd.extend(self.custom_params) @@ -258,6 +258,7 @@ def main(): # Fixed paths input_path = "/app/input" + subprocess.run(f"rm -rf /app/output/* /app/output/.* 2>/dev/null", shell=True) os.makedirs("/app/output", exist_ok=True) if not os.path.isfile(input_path):