[FFmpeg-devel] [RFC] General design for subtitles demuxers

Wolfram Gloger wmglo at dent.med.uni-muenchen.de
Wed Jun 13 17:34:26 CEST 2012

Clément Bœsch <ubitux at gmail.com> writes:

> It might be a possibility, though, from a demuxer point of view, this list
> will be used to create AVPacket (in the read_packet() callback). Which
> will then be used by the main application to create an AVPacket. So the
> situation will looks like:
>   AVSubtitles (demux/read_header) -> AVPacket (demux/read_packet) -> AVSubtitles (decode)
> Sure we can do that (AVSubtitles stores the start & end, and we can put
> some text in it), but it looks very confusing.
> OTOH, we could use AVPacket directly: read_header() constructs a list of
> read-to-use AVPacket (pts, duration and data are in it), and we can raise
> them directly. It should also works for bitmap-based subtitles demuxer.

Maybe I misunderstood you, but as I see it all you want is that
read_header() for pure subtitle formats reads all packets in one go and
queues them up.  Sounds fine, but please use the existing infrastructure
libavformat/utils.c:add_to_pktbuf() (something like
ff_add_to_pktbuf(AVFormatContext *s, AVPacket *p) would need to be newly
exported) and for the computation of the durations
update_initial_durations() would probably best be extended.


More information about the ffmpeg-devel mailing list