Opened 12 years ago

Closed 12 years ago

#1553 closed defect (invalid)

Remuxing mpeg2video from transport stream to matroska fails

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: mpegts mpeg2video av_interleaved_write_frame roundup
Cc: fturco@fastmail.fm Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

(Second, unrelated sample from issue 1719)
Remuxing mpeg2video from ts to mkv fails:

$ ffmpeg -i Ts\ cannot\ be\ muxed\ to\ mkv.ts -vcodec copy -an out.mkv
ffmpeg version N-42605-g5784a46 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 18 2012 20:29:06 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm --enable-libvpx --enable-libxavs --enable-x11grab --enable-libass
  libavutil      51. 65.100 / 51. 65.100
  libavcodec     54. 41.100 / 54. 41.100
  libavformat    54. 17.100 / 54. 17.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  2.100 /  3.  2.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x90774e0] PES packet size mismatch
[mpegts @ 0x90774e0] Could not find codec parameters for stream 2 (Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, s16): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x907c140] start time is not set in estimate_timings_from_pts
[mpegts @ 0x90774e0] PES packet size mismatch
Input #0, mpegts, from 'Ts cannot be muxed to mkv.ts':
  Duration: 00:00:01.78, start: 58016.615744, bitrate: 9158 kb/s
  Program 1
    Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 90000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x34]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, s16, 384 kb/s
    Stream #0:2[0x35]: Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, s16
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf54.17.100
    Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 90000 kb/s, 29.97 fps, 1k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x907f080] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument

Attachments (1)

Ts cannot be muxed to mkv.ts (2.0 MB ) - added by Carl Eugen Hoyos 12 years ago.

Download all attachments as: .zip

Change History (6)

by Carl Eugen Hoyos, 12 years ago

comment:1 by Francesco Turco, 12 years ago

I get a very similar error message, but my input file format is MPEG-PS:

$ ffmpeg -i test.mpeg -c copy -f matroska test.mkv
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  9 2012 13:50:13 with gcc 4.7.0 20120505 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0x2553100] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from 'test.mpeg':
  Duration: 00:18:11.64, start: 1.000000, bitrate: 4833 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 4248 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 4248 kb/s, 25 fps, 1k tbn, 90k tbc
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, 224 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x2559980] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument

comment:2 by Carl Eugen Hoyos, 12 years ago

Works fine with -fflags +genpts:

$ ffmpeg -fflags +genpts -i Ts\ cannot\ be\ muxed\ to\ mkv.ts -vcodec copy -an out.mkv

Please provide a sample if this does not work for you.

comment:3 by Francesco Turco, 12 years ago

Cc: fturco@fastmail.fm added

comment:4 by Carl Eugen Hoyos, 12 years ago

Keywords: roundup added

comment:5 by Carl Eugen Hoyos, 12 years ago

Resolution: invalid
Status: newclosed

I created ticket #1979 with the enhancement request to automatically insert -fflags +genpts if necessary.

Note: See TracTickets for help on using tickets.