[FFmpeg-trac] #8448(ffmpeg:closed): timestamp issue muxing raw .264 into .mkv/.m2ts

FFmpeg trac at avcodec.org
Mon Dec 30 23:01:51 EET 2019


#8448: timestamp issue muxing raw .264 into .mkv/.m2ts
-------------------------------------+-------------------------------------
             Reporter:  Selur        |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:  ffmpeg
              Version:  unspecified  |               Resolution:  duplicate
             Keywords:  264 mux      |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by Selur):

 * keywords:  raw 264 mux => 264 mux


Comment:

 Just for completeness and may be it helps with finding and fixing the bug.

 Even if I don't feed ffmpeg with raw H.264 and use:
 {{{
 ffmpeg -y  -r 24000/1001 -i "E:\Output\Sample_7Ch_videoOnly.mkv" -i
 "E:\Output\audioOnly.dts" -vcodec copy -acodec copy -map 0:0 -map 1:0
 -aspect 177778:100000 -r 24000/1001 "E:\Output\Sample_7Ch-001.mkv"
 }}}
 it fails with:
 {{{
 ffmpeg version N-95921-g8067c0c2eb-ge5db2e96c0+3 Copyright (c) 2000-2019
 the FFmpeg developers
   built with gcc 9.2.0 (Rev2, Built by MSYS2 project)
   configuration:  --disable-autodetect --enable-amf --enable-bzlib
 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-
 iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-
 ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-
 libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-
 libx265 --enable-libdav1d --disable-debug --enable-fontconfig --enable-
 libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-
 libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-
 libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex
 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-
 amrwbenc --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-
 libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid
 --enable-libaom --enable-libopenmpt --enable-version3 --enable-libsvthevc
 --enable-libkvazaar --enable-libxavs --enable-libzmq --enable-libvmaf
 --enable-vapoursynth --enable-librav1e --enable-mbedtls --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-
 cflags=-DZMQ_STATIC --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv
 --disable-w32threads --extra-cflags=-DKVZ_STATIC_LIB
   libavutil      56. 36.101 / 56. 36.101
   libavcodec     58. 64.101 / 58. 64.101
   libavformat    58. 35.100 / 58. 35.100
   libavdevice    58.  9.101 / 58.  9.101
   libavfilter     7. 67.100 /  7. 67.100
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
 [h264 @ 00000243dd0438c0] Stream #0: not enough frames to estimate rate;
 consider increasing probesize
 Input #0, h264, from 'E:\Output\Sample_7Ch_videoOnly.mkv':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR
 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1200k tbn, 47.95 tbc
 [dts @ 00000243dd6dcf40] Estimating duration from bitrate, this may be
 inaccurate
 Input #1, dts, from 'E:\Output\audioOnly.dts':
   Duration: 00:01:01.24, start: 0.000000, bitrate: 1536 kb/s
     Stream #1:0: Audio: dts (DTS-ES), 48000 Hz, 6.1, fltp, 1536 kb/s
 Overriding aspect ratio with stream copy may produce invalid files
 Output #0, matroska, to 'E:\Output\Sample_7Ch-001.mkv':
   Metadata:
     encoder         : Lavf58.35.100
     Stream #0:0: Video: h264 (High) (H264 / 0x34363248),
 yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps,
 23.98 tbr, 1k tbn, 23.98 tbc
     Stream #0:1: Audio: dts (DTS-ES) ([1] [0][0] / 0x2001), 48000 Hz, 6.1,
 fltp, 1536 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #1:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 [matroska @ 00000243dd04b700] Timestamps are unset in a packet for stream
 0. This is deprecated and will stop working in the future. Fix your code
 to set the timestamps properly
 [matroska @ 00000243dd04b700] Can't write packet with unknown timestamp
 av_interleaved_write_frame(): Invalid argument
 frame=    1 fps=0.0 q=-1.0 Lsize=       3kB time=00:00:00.00 bitrate=N/A
 speed=   0x
 video:1kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 Conversion failed!
 }}}

 Shouldn't the .mkv have the time codes needed and shouldn't ffmpeg be able
 to copy those and if mkv doesn't have the needed time codes, why does
 ffmpeg need them?

 Sample_7Ch_videoOnly.mkv was created with mkvextract using:
 {{{
 mkvextract --ui-language en tracks
 "C:\Users\Selur\Desktop\Sample_7Ch-001.mkv"
 0:"E:\Output\Sample_7Ch_videoOnly.mkv"
 }}}

 Funny thing is if I use FFmpeg for the extraction:
 {{{
 ffmpeg -y -threads 8 -i "C:\Users\Selur\Desktop\Sample_7Ch-001.mkv" -sn
 -vcodec copy -map_metadata -1 "E:\Output\Sample_7Ch-
 Sample_7Ch_videoOnly.mkv" -map 0:1 -sn -bsf:a dca_core -acodec copy
 -map_metadata -1 "E:\Output\audioOnly.dts"
 }}}
 the previous muxing call works.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8448#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list