[FFmpeg-user] Muxing MPEG-TS into MP4 changes frame rate

Andy Pryor apryor48 at gmail.com
Mon Mar 16 23:58:55 CET 2015


I'm muxing MPEG-TS into MP4 and the average frame rate is changing from 30
to 156817920/5265377 (~29.77).  The problem is seeking is not consistent
between the containers, the mp4 becomes increasingly off,  proportionate to
the frame rate difference.

There are several areas I've investigated.  I tried forcing the frame rate
using -vsync passthrough and cfr with no change input.  -vsynch drop
produces an error.  I'm not sure if this right approach anyways.  I also
attempted to copy to the time stamps.

Any ideas what might be problem?  Help greatly appreciated!

ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries
stream=avg_frame_rate full-ts.ts
programs_program_0_streams_stream_0_avg_frame_rate="30/1"
streams_stream_0_avg_frame_rate="30/1"

ffmpeg -r 30 -y -i full-ts.ts -c:v copy -r 30 output.mp4
ffmpeg version N-69040-gb23a866 Copyright (c) 2000-2015 the FFmpeg
developers
  built on Jan 12 2015 22:02:37 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --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-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink
--enable-zlib
  libavutil      54. 16.100 / 54. 16.100
  libavcodec     56. 20.100 / 56. 20.100
  libavformat    56. 18.101 / 56. 18.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  7.100 /  5.  7.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'full-ts.ts':
  Duration: 00:11:25.68, start: 1.424000, bitrate: 3407 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 125 kb/s
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf56.18.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], q=2-31, 30 fps, 30 tbr, 15360 tbn, 30 tbc
    Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000
Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.20.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[libvo_aacenc @ 02c268a0] Queue input is backward in time
    Last message repeated 2 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous: 899996,
current: 899036; changing to 899997. This may result in incorrect
timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time09
bitrate=3363.9kbits/s
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
1301391, current: 1300369; changing to 1301392. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
1999522, current: 1998237; changing to 1999523. This may result in
incorrect timestamps in the output file.
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
1999523, current: 1999261; changing to 1999524. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time
[libvo_aacenc @ 02c268a0] Queue input is backward in time.34
bitrate=3243.1kbits/s
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
2447881, current: 2446858; changing to 2447882. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
2733732, current: 2732578; changing to 2733733. This may result in
incorrect timestamps in the output file.
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
2733733, current: 2733602; changing to 2733734. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time.38
bitrate=3261.3kbits/s
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
3943198, current: 3942804; changing to 3943199. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
4287330, current: 4286973; changing to 4287331. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time.53
bitrate=3156.0kbits/s
    Last message repeated 1 times
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
4672817, current: 4672646; changing to 4672818. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time.32
bitrate=3120.3kbits/s
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
17317452, current: 17314382; changing to 17317453. This may result in
incorrect timestamps in the output file.
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
17317453, current: 17315406; changing to 17317454. This may result in
incorrect timestamps in the output file.
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
17317454, current: 17316430; changing to 17317455. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time.15
bitrate=3125.0kbits/s
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
21643247, current: 21642671; changing to 21643248. This may result in
incorrect timestamps in the output file.
[libvo_aacenc @ 02c268a0] Queue input is backward in time.27
bitrate=3124.2kbits/s
[mp4 @ 028c8500] Non-monotonous DTS in output stream 0:1; previous:
30100889, current: 30100317; changing to 30100890. This may result in
incorrect timestamps in the output file.
frame=20419 fps=1396 q=-1.0 Lsize=  262836kB time=00:11:25.81
bitrate=3139.5kbits/s
video:251446kB audio:10651kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.281649%

ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries
stream=avg_frame_rate output.mp4
streams_stream_0_avg_frame_rate="156817920/5265377"


More information about the ffmpeg-user mailing list