[FFmpeg-devel] [PATCH] Read mov/mp4 timed text extradata
David Conrad
lessen42
Sun Jan 11 07:24:38 CET 2009
On Jan 11, 2009, at 1:13 AM, Baptiste Coudurier wrote:
> 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.
Like so?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ttxt-extradata.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090111/486c1d4e/attachment.txt>
-------------- next part --------------
More information about the ffmpeg-devel
mailing list