Compare commits

...

2 Commits

Author SHA1 Message Date
Fuyan Yuan
af84d91b4b
Merge a0d394e2f6 into be3579aaf0 2024-11-10 03:17:30 +05:30
Fuyan Yuan
a0d394e2f6 [FFmpegMerger] Fix merger discard input timestamps
Some website save video-only and audio-only file with non-zero
timestamp. Therefore, when merging them, ffmpeg should keep original
timestamp.

According to ffmpeg doc: https://ffmpeg.org/ffmpeg.html

`-copyts`: Do not process input timestamps, but keep their values
without trying to sanitize them. In particular, do not remove the
initial start time offset value.
2024-01-03 22:58:08 +08:00

View File

@ -825,7 +825,7 @@ class FFmpegMergerPP(FFmpegPostProcessor):
def run(self, info): def run(self, info):
filename = info['filepath'] filename = info['filepath']
temp_filename = prepend_extension(filename, 'temp') temp_filename = prepend_extension(filename, 'temp')
args = ['-c', 'copy'] args = ['-c', 'copy', '-copyts']
audio_streams = 0 audio_streams = 0
for (i, fmt) in enumerate(info['requested_formats']): for (i, fmt) in enumerate(info['requested_formats']):
if fmt.get('acodec') != 'none': if fmt.get('acodec') != 'none':