[FFmpeg-devel] [PATCH] Read mov/mp4 timed text extradata
Baptiste Coudurier
baptiste.coudurier
Sun Jan 11 07:13:49 CET 2009
Hi,
David Conrad wrote:
> Hi,
>
> mov/mp4 timed text stores some needed info for rendering (specifically
> display flags, justification, background color, fonts, and default
> styles) as a part of the stsd atom. Everything except the font table
> (which is a subatom) is an extension of the stsd atom, so unfortunately
> I can't simply add an entry in mov_default_parse_table.
>
> [...]
>
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -978,6 +978,11 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
> }
> } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){
> st->codec->codec_id= id;
> + if (id == CODEC_ID_MOV_TEXT) {
> + st->codec->extradata_size = size - (url_ftell(pb) - start_pos);
> + st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
> + get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
> + }
> } else {
> /* other codec type, just skip (rtp, mp4s, tmcd ...) */
> url_fskip(pb, size - (url_ftell(pb) - start_pos));
>
This duplicates mov_read_glbl, IMHO call it with fake atom.
Besides Iam really thinking about exporting whole 'stsd' atom containing
all extradata, this would avoid exporting on a per case basis, and would
allow user to retrieve all information he desires. We could provide
helpers to parse atoms also.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
More information about the ffmpeg-devel
mailing list