[Ffmpeg-devel] Re: [PATCH] mp4 codecs objecttype handling

Michael Niedermayer michaelni
Sat Feb 11 16:23:03 CET 2006


Hi

On Sat, Feb 11, 2006 at 02:30:40PM +0100, Baptiste COUDURIER wrote:
[...]
> > [...]
> > 
> >> @@ -650,12 +671,22 @@ static int mov_read_esds(MOVContext *c, 
> >>  
> >>      len = mov_mp4_read_descr(pb, &tag);
> >>      if (tag == MP4DecConfigDescrTag) {
> >> +        enum CodecID id;
> >> +
> >>          sc->esds.object_type_id = get_byte(pb);
> >>          sc->esds.stream_type = get_byte(pb);
> >>          sc->esds.buffer_size_db = get_be24(pb);
> >>          sc->esds.max_bitrate = get_be32(pb);
> >>          sc->esds.avg_bitrate = get_be32(pb);
> >>  
> >> +        id = codec_get_id(mp4_codec_tags, sc->esds.object_type_id);
> >> +        if (id >= 0) {
> >> +            AVCodec *codec;
> >> +            codec = avcodec_find_decoder(id);
> >> +            if (codec)
> >> +                st->codec->codec_id = id;
> >> +        }
> > 
> > wth is this supposed to do? why not:
> > 
> > if(st->codec->codec_id <= 0)
> >     st->codec->codec_id= codec_get_id(mp4_codec_tags, sc->esds.object_type_id);
> > 
> > 
> 
> MOV 4CC is 'mp4v' and parser actually assigns codec_id to
> CODEC_ID_MPEG4. And objecttype is MPEG2 for example :
> 
> http://www.coudurier.com/mpeg2_in_mp4.mp4

ok, so sc->esds.object_type_id should be prefered over MOV 4CC


> 
> It is not 0. I just ensure that the codec exists before overriding.

and in which case is that needed / wanted / usefull?


[...]
> +/* http://gpac.sourceforge.net/tutorial/mediatypes.htm */
>  const CodecTag ff_mov_obj_type[] = {

> +    { CODEC_ID_MPEG4     ,   1 },
> +    { CODEC_ID_MPEG4     ,   2 },

i dont think these 2 are correct, CODEC_ID_MPEG4 == MPEG4 video

[...]

-- 
Michael





More information about the ffmpeg-devel mailing list