correct ffmpeg command

This commit is contained in:
user 2025-02-05 11:59:44 +03:00
parent 222d014385
commit 5f4d90d410
1 changed files with 12 additions and 3 deletions

View File

@ -220,11 +220,15 @@ async def s_api_v1_storage_get(request, file_hash=None):
subprocess.run([
"ffmpeg",
"-y",
"-ss", "0", # Seek to start (fast seeking)
"-ss", "0", # Set start time (fast seeking)
"-i", file_path,
"-t", str(seconds_limit), # Set the duration of the output
"-t", str(seconds_limit), # Set duration of the output
"-c:v", "libx264", # Encode video with libx264
"-profile:v", "baseline", # Set baseline profile for compatibility with Telegram
"-level", "3.0", # Set level to 3.0 for compatibility
"-pix_fmt", "yuv420p", # Set pixel format for maximum compatibility
"-c:a", "aac", # Encode audio with AAC
"-b:a", "128k", # Set audio bitrate
"-movflags", "+faststart", # Enable fast start for streaming
tempfile_path
], check=True)
@ -233,10 +237,15 @@ async def s_api_v1_storage_get(request, file_hash=None):
subprocess.run([
"ffmpeg",
"-y",
"-ss", "0", # Seek to start (fast seeking)
"-ss", "0", # Set start time (fast seeking)
"-i", file_path,
# "-t", str(seconds_limit), # Set duration of the output
"-c:v", "libx264", # Encode video with libx264
"-profile:v", "baseline", # Set baseline profile for compatibility with Telegram
"-level", "3.0", # Set level to 3.0 for compatibility
"-pix_fmt", "yuv420p", # Set pixel format for maximum compatibility
"-c:a", "aac", # Encode audio with AAC
"-b:a", "128k", # Set audio bitrate
"-movflags", "+faststart", # Enable fast start for streaming
tempfile_path
], check=True)