Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e4f5ce70b8 | |||
| 8ee7f9fefe |
@@ -389,8 +389,7 @@ class VideoEncoder:
|
|||||||
return False, "Invalid video resolution information"
|
return False, "Invalid video resolution information"
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
'ffmpeg', '-i', input_path, '-c:v', 'libx265', '-c:a', 'copy',
|
'ffmpeg', '-i', input_path
|
||||||
'-preset', 'medium', '-crf', '28', '-f', 'matroska'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add scaling filter if target resolution is specified
|
# Add scaling filter if target resolution is specified
|
||||||
@@ -404,8 +403,10 @@ class VideoEncoder:
|
|||||||
# Ensure width is divisible by 2 (required by video codecs)
|
# Ensure width is divisible by 2 (required by video codecs)
|
||||||
if scale_width % 2 != 0:
|
if scale_width % 2 != 0:
|
||||||
scale_width -= 1
|
scale_width -= 1
|
||||||
cmd.insert(2, f'scale={scale_width}:{target_height}')
|
cmd.extend(['-vf', f'scale={scale_width}:{target_height}'])
|
||||||
cmd.insert(2, '-vf')
|
|
||||||
|
cmd.extend(['-c:v', 'libx265', '-c:a', 'copy',
|
||||||
|
'-preset', 'medium', '-crf', '28', '-f', 'matroska'])
|
||||||
|
|
||||||
# Insert user flags if provided
|
# Insert user flags if provided
|
||||||
if ffmpeg_flags:
|
if ffmpeg_flags:
|
||||||
|
|||||||
Reference in New Issue
Block a user