[FFmpeg-trac] #10525(undetermined:new): Video⁄audio desync between segments in MPV and in VLC is delay between segments and missing subtitles
FFmpeg
trac at avcodec.org
Fri Aug 18 11:50:51 EEST 2023
#10525: Video⁄audio desync between segments in MPV and in VLC is delay between
segments and missing subtitles
-------------------------------------+-------------------------------------
Reporter: 456325 | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: subtitles | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
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 ( [https://drive.proton.me/urls/TDNV2GN8QG#xUQpyO0Gna09
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
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10525>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list