[Libav-user] Fwd: decode/encode subtitles example
marco.gulino at gmail.com
Mon Sep 23 14:04:21 CEST 2013
I'm pretty new to libav* development, and I'm mostly a c++ developer, not
C, so forgive me if I might ask dumb questions.
What I'm trying to achieve is to open a media file and extract a subtitle
Possibly in memory, but using a temp output file would be acceptable.
I did read the muxing/demuxing c examples, and following them I'm already
able to open the file, detect all streams, and decode the subtitle packets,
but I'm stuck in the "reencode" part.
There is an "avcodec_encode_subtitle" API, which seems undocumented
(there's an unofficial doc here, though:
You can see my code here: http://pastebin.com/cUxCs33a .
It's just a spike of course, quick & dirty... If I comment out the
avcodec_encode_subtitle line everything runs just fine, and I can even see
the subtitle lines if I print pkt.data.
the avcodec_encode_subtitle however, when called, always gives me a
Also, it's not clear how to save the buffer data to the newly created
stream (though maybe I won't need it, if the buffer will contain the raw
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user