Opened 16 months ago
#10525 new defect
Video⁄audio desync between segments in MPV and in VLC is delay between segments and missing subtitles
Reported by: | 456325 | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | git-master | Keywords: | subtitles |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
When i cut into 2 segments an .mp4 file that contains also subtitles and then merge the segments, it cause issue:
MPV player: desynchronization between segments
VLC player: delay between segments and missing subtitles
When i exclude subtitles, it plays without problem.
How to reproduce:
# put source.mp4 ( download-here ) into some directory (in my case /dev/shm/) and go to that directory inside a Linux terminal:
cd /dev/shm/
ffmpeg -hide_banner -ss '22.10829' -i 'source.mp4' -t '3.25325' -avoid_negative_ts make_zero -map '0:0' '-c:0' copy -map '0:1' '-c:1' copy -map '0:2' '-c:2' copy -map_metadata 0 -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'source-seg2.mp4.mp4'
ffmpeg -hide_banner -ss '11.13900' -i 'source.mp4' -t '1.00100' -avoid_negative_ts make_zero -map '0:0' '-c:0' copy -map '0:1' '-c:1' copy -map '0:2' '-c:2' copy -map_metadata 0 -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'source-seg1.mp4.mp4'
echo -e "file 'file:source-seg1.mp4.mp4'\nfile 'file:source-seg2.mp4.mp4'" | ffmpeg -hide_banner -f concat -safe 0 -protocol_whitelist 'file,pipe,fd' -i - -map '0:0' '-c:0' copy '-disposition:0' default -map '0:1' '-c:1' copy '-disposition:1' default -map '0:2' '-c:2' copy '-disposition:2' default -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'destination-merged.mp4'
# Play to see described issue:
vlc destination-merged.mp4
mpv destination-merged.mp4
# When excluding subtitles, it plays without apparent problem:
ffmpeg -hide_banner -ss '22.10829' -i 'source.mp4' -t '3.25325' -avoid_negative_ts make_zero -map '0:0' '-c:0' copy -map '0:1' '-c:1' copy -map_metadata 0 -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'source-seg2-nosubs.mp4.mp4'
ffmpeg -hide_banner -ss '11.13900' -i 'source.mp4' -t '1.00100' -avoid_negative_ts make_zero -map '0:0' '-c:0' copy -map '0:1' '-c:1' copy -map_metadata 0 -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'source-seg1-nosubs.mp4.mp4'
echo -e "file 'file:source-seg1-nosubs.mp4.mp4'\nfile 'file:source-seg2-nosubs.mp4.mp4'" | ffmpeg -hide_banner -f concat -safe 0 -protocol_whitelist 'file,pipe,fd' -i - -map '0:0' '-c:0' copy '-disposition:0' default -map '0:1' '-c:1' copy '-disposition:1' default -default_mode infer_no_subs -ignore_unknown -f mp4 -y 'destination-merged-nosubs.mp4'
# Play to see no issue:
vlc destination-merged-nosubs.mp4
mpv destination-merged-nosubs.mp4