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)
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):