final codecs

This commit is contained in:
user 2025-02-23 17:58:48 +03:00
parent f1bb2ba031
commit d1126b7cf6
1 changed files with 6 additions and 5 deletions

View File

@ -124,8 +124,6 @@ class MediaDetector:
logging.error("Error running ffprobe: %s", e.stderr) logging.error("Error running ffprobe: %s", e.stderr)
sys.exit(1) sys.exit(1)
# ============================================================================= # =============================================================================
# Conversion Strategy Base Class and Implementations # Conversion Strategy Base Class and Implementations
# ============================================================================= # =============================================================================
@ -148,12 +146,14 @@ class ConversionStrategy:
logging.info("Conversion completed successfully.") logging.info("Conversion completed successfully.")
class VideoHighStrategy(ConversionStrategy): 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): def convert(self, input_file, output_file):
cmd = [ cmd = [
"ffmpeg", "-y", "-i", input_file, "ffmpeg", "-y", "-i", input_file,
"-c:v", "prores_ks", "-profile:v", "3", "-c:v", "libx264", "-preset", "veryslow", "-crf", "18",
"-c:a", "pcm_s16le" "-pix_fmt", "yuv420p",
"-movflags", "+faststart",
"-c:a", "pcm_s16le" # Lossless audio using PCM
] ]
if hasattr(self, "custom_params"): if hasattr(self, "custom_params"):
cmd.extend(self.custom_params) cmd.extend(self.custom_params)
@ -258,6 +258,7 @@ def main():
# Fixed paths # Fixed paths
input_path = "/app/input" 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) os.makedirs("/app/output", exist_ok=True)
if not os.path.isfile(input_path): if not os.path.isfile(input_path):