#11642: ffmpeg -ss -c copy causes MP4 vobsub timestamps to be incorrectly 
shifted
----------------------------------+----------------------------------
             Reporter:  runderwo  |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  ffmpeg    |                  Version:  7.1
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+----------------------------------
 Summary of the bug:
 Changing the start time of a video causes the start time of the first
 vobsub subtitle to be moved to timestamp 0 in the file (i.e., the first
 subtitle is immediately rendered when the file is played and all the rest
 of the subtitles show at the wrong time).

 The correct behavior should be that the subtitle time offsets are shifted
 by the same amount of time as the rest of the container data.

 How to reproduce:
 {{{
 $ ffmpeg -ss 129 -i 02.mp4 -map 0 -c copy out2.mp4
 ffmpeg version 7.1.1-1ubuntu1.1 Copyright (c) 2000-2025 the FFmpeg
 developers
   built with gcc 14 (Ubuntu 14.2.0-19ubuntu2)
   configuration: --prefix=/usr --extra-version=1ubuntu1.1
 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
 --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
 --disable-stripping --disable-libmfx --disable-omx --enable-gnutls
 --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio
 --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-
 libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang
 --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame
 --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-
 libopus --enable-librubberband --enable-libshine --enable-libsnappy
 --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp
 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
 --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-
 libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-
 chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-
 libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-
 libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-
 libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-
 libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e
 --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
   WARNING: library configuration mismatch
   avcodec     configuration: --prefix=/usr --extra-version=1ubuntu1.1
 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
 --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
 --disable-stripping --disable-libmfx --disable-omx --enable-gnutls
 --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio
 --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-
 libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang
 --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame
 --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-
 libopus --enable-librubberband --enable-libshine --enable-libsnappy
 --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp
 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
 --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-
 libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-
 chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-
 libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-
 libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-
 libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-
 libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e
 --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
 --enable-version3 --disable-doc --disable-programs --disable-static
 --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb
 --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
   libavutil      59. 39.100 / 59. 39.100
   libavcodec     61. 19.101 / 61. 19.101
   libavformat    61.  7.100 / 61.  7.100
   libavdevice    61.  3.100 / 61.  3.100
   libavfilter    10.  4.100 / 10.  4.100
   libswscale      8.  3.100 /  8.  3.100
   libswresample   5.  3.100 /  5.  3.100
   libpostproc    58.  3.100 / 58.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '02.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 512
     compatible_brands: mp42dby1iso2avc1mp41
     creation_time   : 2025-06-21T03:50:09.000000Z
     encoder         : HandBrake 1.9.2 2025022300
   Duration: 02:19:34.64, start: 0.000000, bitrate: 5401 kb/s
   Chapters:
     Chapter #0:0: start 0.000000, end 133.160000
       Metadata:
         title           : Chapter 1
     Chapter #0:1: start 133.160000, end 409.760000
       Metadata:
         title           : Chapter 2
     Chapter #0:2: start 409.760000, end 802.000000
       Metadata:
         title           : Chapter 3
     Chapter #0:3: start 802.000000, end 1025.400000
       Metadata:
         title           : Chapter 4
     Chapter #0:4: start 1025.400000, end 1295.560000
       Metadata:
         title           : Chapter 5
     Chapter #0:5: start 1295.560000, end 1723.120000
       Metadata:
         title           : Chapter 6
     Chapter #0:6: start 1723.120000, end 2093.720000
       Metadata:
         title           : Chapter 7
     Chapter #0:7: start 2093.720000, end 2397.760000
       Metadata:
         title           : Chapter 8
     Chapter #0:8: start 2397.760000, end 2754.400000
       Metadata:
         title           : Chapter 9
     Chapter #0:9: start 2754.400000, end 3007.960000
       Metadata:
         title           : Chapter 10
     Chapter #0:10: start 3007.960000, end 3371.680000
       Metadata:
         title           : Chapter 11
     Chapter #0:11: start 3371.680000, end 3909.080000
       Metadata:
         title           : Chapter 12
     Chapter #0:12: start 3909.080000, end 4421.360000
       Metadata:
         title           : Chapter 13
     Chapter #0:13: start 4421.360000, end 4942.280000
       Metadata:
         title           : Chapter 14
     Chapter #0:14: start 4942.280000, end 5521.960000
       Metadata:
         title           : Chapter 15
     Chapter #0:15: start 5521.960000, end 6031.480000
       Metadata:
         title           : Chapter 16
     Chapter #0:16: start 6031.480000, end 6438.440000
       Metadata:
         title           : Chapter 17
     Chapter #0:17: start 6438.440000, end 6671.440000
       Metadata:
         title           : Chapter 18
     Chapter #0:18: start 6671.440000, end 7214.200000
       Metadata:
         title           : Chapter 19
     Chapter #0:19: start 7214.200000, end 7651.840000
       Metadata:
         title           : Chapter 20
     Chapter #0:20: start 7651.840000, end 7907.760000
       Metadata:
         title           : Chapter 21
     Chapter #0:21: start 7907.760000, end 8111.240000
       Metadata:
         title           : Chapter 22
     Chapter #0:22: start 8111.240000, end 8302.560000
       Metadata:
         title           : Chapter 23
     Chapter #0:23: start 8302.560000, end 8373.160000
       Metadata:
         title           : Chapter 24
     Chapter #0:24: start 8373.160000, end 8374.600000
       Metadata:
         title           : Chapter 25
   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
 yuv420p(tv, smpte170m/bt470bg/bt709, progressive), 698x576 [SAR 16:15 DAR
 349:270], 4680 kb/s, 25 fps, 25 tbr, 90k tbn (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : VideoHandler
         vendor_id       : [0][0][0][0]
   Stream #0:1[0x2](deu): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
 stereo, fltp, 159 kb/s (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
   Stream #0:2[0x3](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
 stereo, fltp, 159 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
        vendor_id       : [0][0][0][0]
   Stream #0:3[0x4](deu): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo,
 fltp, 192 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
       Side data:
         audio service type: main
   Stream #0:4[0x5](eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo,
 fltp, 192 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
       Side data:
         audio service type: main
   Stream #0:5[0x6](deu): Subtitle: dvd_subtitle (dvdsub) (mp4s /
 0x7334706D), 720x576, 0 kb/s (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : SubtitleHandler
   Stream #0:6[0x7](eng): Data: bin_data (text / 0x74786574)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : SubtitleHandler
 File 'out2.mp4' already exists. Overwrite? [y/N] Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
   Stream #0:2 -> #0:2 (copy)
   Stream #0:3 -> #0:3 (copy)
   Stream #0:4 -> #0:4 (copy)
   Stream #0:5 -> #0:5 (copy)
   Stream #0:6 -> #0:6 (copy)
 [mp4 @ 0x64ce9d2f68c0] track 3: codec frame size is not set
 [mp4 @ 0x64ce9d2f68c0] track 4: codec frame size is not set
 Output #0, mp4, to 'out2.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 512
     compatible_brands: mp42dby1iso2avc1mp41
     encoder         : Lavf61.7.100
   Chapters:
     Chapter #0:0: start 0.000000, end 4.160000
       Metadata:
         title           : Chapter 1
     Chapter #0:1: start 4.160000, end 280.760000
       Metadata:
         title           : Chapter 2
     Chapter #0:2: start 280.760000, end 673.000000
       Metadata:
         title           : Chapter 3
     Chapter #0:3: start 673.000000, end 896.400000
       Metadata:
         title           : Chapter 4
     Chapter #0:4: start 896.400000, end 1166.560000
       Metadata:
         title           : Chapter 5
     Chapter #0:5: start 1166.560000, end 1594.120000
       Metadata:
         title           : Chapter 6
     Chapter #0:6: start 1594.120000, end 1964.720000
       Metadata:
         title           : Chapter 7
     Chapter #0:7: start 1964.720000, end 2268.760000
       Metadata:
         title           : Chapter 8
     Chapter #0:8: start 2268.760000, end 2625.400000
       Metadata:
         title           : Chapter 9
     Chapter #0:9: start 2625.400000, end 2878.960000
       Metadata:
         title           : Chapter 10
     Chapter #0:10: start 2878.960000, end 3242.680000
       Metadata:
         title           : Chapter 11
     Chapter #0:11: start 3242.680000, end 3780.080000
       Metadata:
         title           : Chapter 12
     Chapter #0:12: start 3780.080000, end 4292.360000
       Metadata:
         title           : Chapter 13
     Chapter #0:13: start 4292.360000, end 4813.280000
       Metadata:
         title           : Chapter 14
     Chapter #0:14: start 4813.280000, end 5392.960000
       Metadata:
         title           : Chapter 15
     Chapter #0:15: start 5392.960000, end 5902.480000
       Metadata:
         title           : Chapter 16
     Chapter #0:16: start 5902.480000, end 6309.440000
       Metadata:
         title           : Chapter 17
     Chapter #0:17: start 6309.440000, end 6542.440000
       Metadata:
         title           : Chapter 18
     Chapter #0:18: start 6542.440000, end 7085.200000
       Metadata:
         title           : Chapter 19
     Chapter #0:19: start 7085.200000, end 7522.840000
       Metadata:
         title           : Chapter 20
     Chapter #0:20: start 7522.840000, end 7778.760000
       Metadata:
         title           : Chapter 21
     Chapter #0:21: start 7778.760000, end 7982.240000
       Metadata:
         title           : Chapter 22
     Chapter #0:22: start 7982.240000, end 8173.560000
       Metadata:
         title           : Chapter 23
     Chapter #0:23: start 8173.560000, end 8244.160000
       Metadata:
         title           : Chapter 24
     Chapter #0:24: start 8244.160000, end 8245.600000
       Metadata:
         title           : Chapter 25
   Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
 smpte170m/bt470bg/bt709, progressive), 698x576 [SAR 16:15 DAR 349:270],
 q=2-31, 4680 kb/s, 25 fps, 25 tbr, 90k tbn (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : VideoHandler
         vendor_id       : [0][0][0][0]
   Stream #0:1(deu): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 159 kb/s (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
   Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 159 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
   Stream #0:3(deu): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo,
 fltp, 192 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
       Side data:
         audio service type: main
   Stream #0:4(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo,
 fltp, 192 kb/s
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : Stereo
         vendor_id       : [0][0][0][0]
       Side data:
         audio service type: main
   Stream #0:5(deu): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 0
 kb/s (default)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : SubtitleHandler
   Stream #0:6(eng): Data: bin_data (gpmd / 0x646D7067)
       Metadata:
         creation_time   : 2025-06-21T03:50:09.000000Z
         handler_name    : SubtitleHandler
 [..]
 frame=206142 fps=4521 q=-1.0 Lsize= 5432964KiB time=01:57:28.39
 bitrate=6314.5kbits/s speed= 155x
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11642>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to