correct ffmpeg command

This commit is contained in:
user 2025-02-05 11:54:54 +03:00
parent 9daa45789d
commit 222d014385
1 changed files with 9 additions and 18 deletions

View File

@ -220,17 +220,12 @@ async def s_api_v1_storage_get(request, file_hash=None):
subprocess.run([ subprocess.run([
"ffmpeg", "ffmpeg",
"-y", "-y",
"-ss", "0", # Set start time if needed "-ss", "0", # Seek to start (fast seeking)
"-i", file_path, "-i", file_path,
"-t", str(seconds_limit), "-t", str(seconds_limit), # Set the duration of the output
"-c:v", "libx264", "-c:v", "libx264", # Encode video with libx264
"-preset", "medium", # Set encoding preset for better compatibility "-c:a", "aac", # Encode audio with AAC
"-profile:v", "main", # Set profile for compatibility
"-pix_fmt", "yuv420p", # Set pixel format for compatibility
"-c:a", "aac",
"-b:a", "192k", # Set audio bitrate
"-movflags", "+faststart", # Enable fast start for streaming "-movflags", "+faststart", # Enable fast start for streaming
"-map", "0", # Map all streams from the input
tempfile_path tempfile_path
], check=True) ], check=True)
else: else:
@ -238,15 +233,11 @@ async def s_api_v1_storage_get(request, file_hash=None):
subprocess.run([ subprocess.run([
"ffmpeg", "ffmpeg",
"-y", "-y",
"-ss", "0", # Seek to start (fast seeking)
"-i", file_path, "-i", file_path,
"-c:v", "libx264", "-c:v", "libx264", # Encode video with libx264
"-preset", "medium", # Set encoding preset for better compatibility "-c:a", "aac", # Encode audio with AAC
"-profile:v", "main", # Set profile for compatibility
"-pix_fmt", "yuv420p", # Set pixel format for compatibility
"-c:a", "aac",
"-b:a", "192k", # Set audio bitrate
"-movflags", "+faststart", # Enable fast start for streaming "-movflags", "+faststart", # Enable fast start for streaming
"-map", "0", # Map all streams from the input
tempfile_path tempfile_path
], check=True) ], check=True)
except BaseException as e: except BaseException as e: