[FFmpeg-trac] #5784(avformat:new): Regression: mkv encoder DTS discontinuity
FFmpeg
trac at avcodec.org
Thu Aug 18 17:17:45 EEST 2016
#5784: Regression: mkv encoder DTS discontinuity
-------------------------------------+-------------------------------------
Reporter: mbat | Owner:
Type: defect | Status: new
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: mkv | Blocked By:
regression | Reproduced by developer: 0
Blocking: |
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by mbat):
Step by step instructions to reproduce DTS errors:
1. Download attached sample ({{{test.mp4}}});
2. Run {{{ffmpeg -i test.mp4 -c copy test.mkv}}};
3. Output:
{{{
ffmpeg version N-81378-gbba6a03 Copyright (c) 2000-2016 the FFmpeg
developers
built with gcc 5.4.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-
version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-
nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-
fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-librtmp --enable-
libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-
libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-
libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 53.100 / 57. 53.100
libavformat 57. 47.101 / 57. 47.101
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 52.100 / 6. 52.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.47.101
Duration: 00:00:10.02, start: 0.000000, bitrate: 1287 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
720x576 [SAR 64:45 DAR 16:9], 1201 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
(default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 81 kb/s (default)
Metadata:
handler_name : SoundHandler
[matroska @ 023fba20] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, matroska, to 'test.mkv':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.47.101
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
720x576 [SAR 64:45 DAR 16:9], q=2-31, 1201 kb/s, 25 fps, 25 tbr, 1k tbn,
12800 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz,
stereo, 81 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 250 fps=0.0 q=-1.0 Lsize= 1572kB time=00:00:10.00
bitrate=1287.0kbits/s speed= 592x
video:1466kB audio:100kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.370809%
}}}
4. Since video track has been copied ({{{-c copy}}}) PTS, DTS and all
timecodes of video track must be the same (timebase apart);
5. But...this is not what I've found;
6. Run {{{ffprobe -show_frames test.mkv > mkv.txt}}} and {{{ffprobe
-show_frames test.mp4 > mp4.txt}}};
7. Open the .txt files previously generated;
8. Extract {{{pkt_dts_time}}} fields of video track;
9. For {{{mp4.txt}}} you'll find (diffs in ms on side):
{{{
pkt_dts_time=0.000000
pkt_dts_time=0.040000 40
pkt_dts_time=0.080000 40
pkt_dts_time=0.120000 40
pkt_dts_time=0.160000 40
pkt_dts_time=0.200000 40
...
}}}
10. For {{{mkv.txt}}} you'll find (diffs in ms on side):
{{{
pkt_dts_time=0.000000
pkt_dts_time=0.061000 61
pkt_dts_time=0.101000 40
pkt_dts_time=0.141000 40
pkt_dts_time=0.160000 19
pkt_dts_time=0.221000 61
...
}}}
As you can see, DTS in .mkv is not regular like in .mp4. With old ffmpeg
builds (2015-02-03 i.e.), it was.
Thanks,
MB
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5784#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list