Opened 10 years ago

Closed 10 years ago

#3810 closed defect (invalid)

mpegts muxer creates non-zero start time

Reported by: slhck Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

$ ffmpeg -i BigBuckBunny-trailer-1080p.ogg -c:v libx264 -t 2 -an -f mpegts out.ts
ffmpeg version N-65018-gad91bf8 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 26 2014 22:09:15 with gcc 4.8.3 (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-libschroedinger --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-decklink --enable-zlib
  libavutil      52. 92.101 / 52. 92.101
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 49.100 / 55. 49.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[theora @ 00000000002fffe0] 7 bits left in packet 82
Input #0, ogg, from 'BigBuckBunny-trailer-1080p.ogg':
  Duration: 00:00:33.00, start: 0.000000, bitrate: 6757 kb/s
    Stream #0:0: Video: theora, yuv420p(bt470bg), 1920x1080, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : ffmpeg2theora 0.19
    Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp, 80 kb/s
    Metadata:
      ENCODER         : ffmpeg2theora 0.19
[libx264 @ 00000000051ebac0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 00000000051ebac0] profile High, level 4.0
[theora @ 00000000003bf7e0] 7 bits left in packet 82
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf55.49.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080, q=-1--1, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc55.69.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (theora (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=   50 fps= 30 q=-1.0 Lsize=     122kB time=00:00:01.92 bitrate= 520.9kbits/s
video:107kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 14.412790%
[libx264 @ 00000000051ebac0] frame I:1     Avg QP:18.79  size:  1317
[libx264 @ 00000000051ebac0] frame P:15    Avg QP:16.73  size:  4627
[libx264 @ 00000000051ebac0] frame B:34    Avg QP:20.98  size:  1134
[libx264 @ 00000000051ebac0] consecutive B-frames:  8.0%  4.0%  0.0% 88.0%
[libx264 @ 00000000051ebac0] mb I  I16..4:  0.0% 100.0%  0.0%
[libx264 @ 00000000051ebac0] mb P  I16..4:  3.9%  2.8%  0.3%  P16..4:  5.0%  1.3%  0.7%  0.0%  0.0%    skip:86.1%
[libx264 @ 00000000051ebac0] mb B  I16..4:  1.0%  0.5%  0.0%  B16..8: 10.3%  0.3%  0.0%  direct: 0.2%  skip:87.8%  L0:51.2% L1:45.8% BI: 3.0%
[libx264 @ 00000000051ebac0] 8x8 transform intra:62.2% inter:74.1%
[libx264 @ 00000000051ebac0] coded y,uvDC,uvAC intra: 3.0% 6.7% 3.9% inter: 0.6% 1.2% 0.6%
[libx264 @ 00000000051ebac0] i16 v,h,dc,p: 27% 72%  0%  0%
[libx264 @ 00000000051ebac0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  3% 65% 30%  1%  0%  0%  0%  0%  1%
[libx264 @ 00000000051ebac0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 48% 26% 17%  2%  2%  2%  1%  1%  1%
[libx264 @ 00000000051ebac0] i8c dc,h,v,p: 90%  4%  6%  0%
[libx264 @ 00000000051ebac0] Weighted P-Frames: Y:40.0% UV:40.0%
[libx264 @ 00000000051ebac0] ref P L0: 72.3%  6.1% 13.9%  6.4%  1.2%
[libx264 @ 00000000051ebac0] ref B L0: 71.8% 22.3%  5.9%
[libx264 @ 00000000051ebac0] ref B L1: 88.1% 11.9%
[libx264 @ 00000000051ebac0] kb/s:437.08

When inspecting the output file:

$ ffprobe -select_streams v -show_frames -of compact -show_entries frame=pict_type,pkt_pts_time out.ts
frame|pkt_pts_time=1.480000|pict_type=I
frame|pkt_pts_time=1.520000|pict_type=B
frame|pkt_pts_time=1.560000|pict_type=B
frame|pkt_pts_time=1.600000|pict_type=B
frame|pkt_pts_time=1.640000|pict_type=P
frame|pkt_pts_time=1.680000|pict_type=B
frame|pkt_pts_time=1.720000|pict_type=B
frame|pkt_pts_time=1.760000|pict_type=B
frame|pkt_pts_time=1.800000|pict_type=P
frame|pkt_pts_time=1.840000|pict_type=B
frame|pkt_pts_time=1.880000|pict_type=B
frame|pkt_pts_time=1.920000|pict_type=B
frame|pkt_pts_time=1.960000|pict_type=P
frame|pkt_pts_time=2.000000|pict_type=B
frame|pkt_pts_time=2.040000|pict_type=P
frame|pkt_pts_time=2.080000|pict_type=P
frame|pkt_pts_time=2.120000|pict_type=P
frame|pkt_pts_time=2.160000|pict_type=B
frame|pkt_pts_time=2.200000|pict_type=B
frame|pkt_pts_time=2.240000|pict_type=B
frame|pkt_pts_time=2.280000|pict_type=P
frame|pkt_pts_time=2.320000|pict_type=P
frame|pkt_pts_time=2.360000|pict_type=B
frame|pkt_pts_time=2.400000|pict_type=B
frame|pkt_pts_time=2.440000|pict_type=B
frame|pkt_pts_time=2.480000|pict_type=P
frame|pkt_pts_time=2.520000|pict_type=B
frame|pkt_pts_time=2.560000|pict_type=B
frame|pkt_pts_time=2.600000|pict_type=B
frame|pkt_pts_time=2.640000|pict_type=P
frame|pkt_pts_time=2.680000|pict_type=B
frame|pkt_pts_time=2.720000|pict_type=B
frame|pkt_pts_time=2.760000|pict_type=B
frame|pkt_pts_time=2.800000|pict_type=P
frame|pkt_pts_time=2.840000|pict_type=B
frame|pkt_pts_time=2.880000|pict_type=B
frame|pkt_pts_time=2.920000|pict_type=B
frame|pkt_pts_time=2.960000|pict_type=P
frame|pkt_pts_time=3.000000|pict_type=B
frame|pkt_pts_time=3.040000|pict_type=B
frame|pkt_pts_time=3.080000|pict_type=B
frame|pkt_pts_time=3.120000|pict_type=P
frame|pkt_pts_time=3.160000|pict_type=B
frame|pkt_pts_time=3.200000|pict_type=B
frame|pkt_pts_time=3.240000|pict_type=B
frame|pkt_pts_time=3.280000|pict_type=P
frame|pkt_pts_time=3.320000|pict_type=B
frame|pkt_pts_time=3.360000|pict_type=B
frame|pkt_pts_time=3.400000|pict_type=B
frame|pkt_pts_time=3.440000|pict_type=P
ffprobe version N-65018-gad91bf8 Copyright (c) 2007-2014 the FFmpeg developers
  built on Jul 26 2014 22:09:15 with gcc 4.8.3 (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-libschroedinger --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-decklink --enable-zlib
  libavutil      52. 92.101 / 52. 92.101
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 49.100 / 55. 49.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from 'out.ts':
  Duration: 00:00:02.00, start: 1.480000, bitrate: 500 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc

One would expect the output transport stream to start with zero PTS, not some arbitrary (?) offset.

With MP4 as container though, PTS start with 0.

Change History (1)

comment:1 by Kieran Kunhya, 10 years ago

Resolution: invalid
Status: newclosed

Read the TS spec. A zero PTS is meaningless in MPEG-TS.

Note: See TracTickets for help on using tickets.