Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7411 closed defect (duplicate)

“Can't write packet with unknown timestamp” from a MTS file remuxing to a MKV file

Reported by: Kdmeizk Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: h264 mpegts av_interleaved_write_frame
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Versions:

  • 3.2
  • 4.0.2
  • 91805-g7bb90a9449 / 20180906-7bb90a9

Command:
ffmpeg -i input.mts -codec copy output.mkv

Log:

ffmpeg version N-91805-g7bb90a9449 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.100 / 56. 19.100
  libavcodec     58. 27.101 / 58. 27.101
  libavformat    58. 18.100 / 58. 18.100
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 26.100 /  7. 26.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[h264 @ 0000000000334740] mmco: unref short failure
[h264 @ 0000000000334740] Increasing reorder buffer to 2
[h264 @ 0000000000334740] Increasing reorder buffer to 3
Input #0, mpegts, from 'input.mts':
  Duration: 00:01:08.93, start: 1.400000, bitrate: 4306 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](fra): Audio: eac3 ([135][0][0][0] / 0x0087), 48000 Hz, stereo, fltp, 128 kb/s
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf58.18.100
    Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 90k tbc
    Stream #0:1(fra): Audio: eac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0000000002dbf340] 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 @ 0000000002dbf340] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska @ 0000000002dbf340] Can't write packet with unknown timestamp
Error writing trailer of output.mkv: Invalid argument
frame=   10 fps=0.0 q=-1.0 Lsize=      49kB time=00:00:01.07 bitrate= 371.7kbits/s speed=N/A    
video:166kB audio:15kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

Change History (6)

comment:2 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavcodec
Keywords: h264 mpegts av_interleaved_write_frame added
Resolution: duplicate
Status: newclosed
Version: unspecifiedgit-master

This is a duplicate of several other issues (no timestamps for some h264 streams), for example ticket #6903.
For future tickets: Please do not use FFmpeg to shorten samples, for transport streams, dd is the right tool.

comment:4 by Carl Eugen Hoyos, 6 years ago

Yes, I don't know of a Windows equivalent atm.

comment:5 by Kdmeizk, 6 years ago

It’s OK, I have a UNIX system too.

Thank you for your advice!

comment:6 by Gyan, 6 years ago

FYI, the gow suite has a dd port for Windows.

Note: See TracTickets for help on using tickets.