[Libav-user] Zero PTS in decoded subttiles.

k.savkov k.savkov at inventos.ru
Fri Feb 5 15:53:01 CET 2016


Hi.
I'm currently working on the subtitles decoding and facing a problem 
with timestamps. When I'm using AVCodecContext which I have recived 
while demuxing from AVFormatContext->streams->codec, everything is nice 
and good, but when I'm trying to decode subtitles with AVCodecContext 
allocated by avcodec_alloc_context3, I'm getting subtitle with zeroes in 
PTS, start_time and end_time. Here is the example:

AVCodecContext from AVFormatContext
PTS: 4700000
ASS: Dialogue: 0,0:00:04.70,0:00:06.74,Default,,0,0,0,,where are you 
going so early?

AVCodecContext allocated by me
PTS: 0
ASS: Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,,where are you 
going so early?

In the project I'm working on it's prefered for the packets to be 
decoded in some other place rather then in demuxer, so what is the right 
way to open the right codec context for subtitles?

With best regards, Kirill.


More information about the Libav-user mailing list