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