[FFmpeg-user] mpegts exceed 33-bit

Shmulik Yoffe shmulik at wsc-sports.com
Fri Mar 17 19:28:34 EET 2017


Hi all

Thanks for your help!
Attached two files from an HLS stream.
http://www.clipro.tv/examples/example.zip

Using ffprobe, I can see the start PTS of both streams. I'll just copy the command line and the important line that return:

ffprobe -i 63a2061a-e871-438b-baf3-a05a1ff7a7aa_000000976.ts -show_streams ...
...
[STREAM]
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 profile=Main codec_type=video
codec_time_base=1001/60000
codec_tag_string=[27][0][0][0]
...
start_pts=8584135560
start_time=95379.284000
...
[/STREAM]
...

ffprobe -i 63a2061a-e871-438b-baf3-a05a1ff7a7aa_000000977.ts -show_streams ...
...
[STREAM]
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 profile=Main codec_type=video
codec_time_base=1001/60000
codec_tag_string=[27][0][0][0]
...
start_pts=-5258492
start_time=-58.427689
...
[/STREAM]
...

As you can see, the second file has start_pts=-5258492.
(int)-5258492 & 0x1ffffffff = 8584676100

So, the pts is correct, it just has additional bits.

When using ffmpeg like this:
ffmpeg -i 63a2061a-e871-438b-baf3-a05a1ff7a7aa_000000977.ts -copyts -vcodec libx264 -acodec aac -strict experimental out.ts ffmpeg version N-83657-g7e4f32f Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --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-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 81.100 / 57. 81.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 74.100 /  6. 74.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mpegts, from '63a2061a-e871-438b-baf3-a05a1ff7a7aa_000000977.ts':
  Duration: 00:00:06.01, start: -58.427689, bitrate: 4749 kb/s
  Program 1
    Stream #0:0[0x1e4]: Data: timed_id3 (ID3  / 0x20334449)
    Stream #0:1[0x1e1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x1e2]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 128 kb/s
[libx264 @ 0000000002d53320] using SAR=1/1
[libx264 @ 0000000002d53320] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0000000002d53320] profile High, level 3.1 Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf57.66.102
    Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 90k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.81.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc57.81.100 aac
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=0.0 Lsize=     108kB time=00:00:00.00 bitrate=N/A dup=0 drop=180 speed=   0x
video:0kB audio:94kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 15.167373% [aac @ 0000000002d3fc20] Qavg: 311.123


I get an invalid ts file - with no video. The same arguments on the good file result in a good output, when all the pts are saved.

I need a way to correctly re-encode the bad file, while saving it's pts.

Thanks!





-----Original Message-----
From: ffmpeg-user [mailto:ffmpeg-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos
Sent: Thursday, March 16, 2017 9:43 PM
To: FFmpeg user questions <ffmpeg-user at ffmpeg.org>
Subject: Re: [FFmpeg-user] mpegts exceed 33-bit

2017-03-16 14:07 GMT+01:00 Shmulik Yoffe <shmulik at wsc-sports.com>:

> Lately I came across strange behavior of my source stream - when it 
> gets new the 33-bit limit, several chunks (about 1 minute) have invalid PTS.

Please provide an input sample.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list