[FFmpeg-user] mpegts exceed 33-bit

Shmulik Yoffe shmulik at wsc-sports.com
Thu Mar 16 15:07:14 EET 2017



I'd like to as the group for help on a specific issue:


I need to do in-place encoding of HLS chunks. I get the chunks, and
re-encode it using the -copyts argument to save the original PTS of video
and audio.

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.

For example, a chunks can start at PTS=-5258492, which is actually, in
binary 1111111111111111111111111111111111111111101011111100001100000100

If I would just truncate this value to 33-bit, I will get 8584676100 which
is the correct PTS value.


In that case ffmpeg reads the PTS as negative number, and just convert it
wrongly when using -copyts.

I tried using setpts and asetpts to manually set the PTS to the computed PTS
(the 33-bit truncated value) value, but couldn't get it to work.


I would like to ask if anyone known why this is happening, if these extra
bits have any meaning or usage or if it's a problem with the encoder, and
how can I make ffmpeg work with it.



More information about the ffmpeg-user mailing list