Compare commits

...

2 Commits

Author SHA1 Message Date
Fuyan Yuan
7b97862d4a
Merge a0d394e2f6 into da252d9d32 2024-11-18 09:28:58 +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

@ -824,7 +824,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':