[Ffmpeg-devel] Re: [PATCH] mp4 codecs objecttype handling
Baptiste COUDURIER
baptiste.coudurier
Sat Feb 11 14:30:40 CET 2006
Hi,
Michael Niedermayer wrote:
> Hi
>
> On Sat, Feb 11, 2006 at 01:38:40AM +0100, Baptiste COUDURIER wrote:
>> Hi,
>>
>> This patch adds mp4 specific codec objecttype handling is esds atom.
>
> [...]
>
>>
>> +/* http://gpac.sourceforge.net/tutorial/mediatypes.htm */
>> +static const CodecTag mp4_codec_tags[] = {
>> + { CODEC_ID_MPEG4 , 0x01 }, /* MPEG4 Systems 1 */
>> + { CODEC_ID_MPEG4 , 0x02 }, /* MPEG4 Systems 2 */
>> + { CODEC_ID_MPEG4 , 0x20 }, /* MPEG4 */
>> + { CODEC_ID_AAC , 0x40 }, /* MPEG4 Audio */
>> + { CODEC_ID_MPEG2VIDEO, 0x60 }, /* MPEG2 Simple */
>> + { CODEC_ID_MPEG2VIDEO, 0x61 }, /* MPEG2 Main */
>> + { CODEC_ID_MPEG2VIDEO, 0x62 }, /* MPEG2 SNR */
>> + { CODEC_ID_MPEG2VIDEO, 0x63 }, /* MPEG2 Spatial */
>> + { CODEC_ID_MPEG2VIDEO, 0x64 }, /* MPEG2 High */
>> + { CODEC_ID_MPEG2VIDEO, 0x65 }, /* MPEG2 422 */
>> + { CODEC_ID_AAC , 0x66 }, /* MPEG2 AAC Main */
>> + { CODEC_ID_AAC , 0x67 }, /* MPEG2 AAC Low */
>> + { CODEC_ID_AAC , 0x68 }, /* MPEG2 AAC SSR */
>> + { CODEC_ID_MP3 , 0x69 }, /* MP3 */
>> + { CODEC_ID_MPEG1VIDEO, 0x6A }, /* MPEG1 Video */
>> + { CODEC_ID_MP2 , 0x6B }, /* MPEG1 Audio */
>> + { CODEC_ID_MJPEG , 0x6C }, /* JPEG Video */
>> +};
>
> duplicate of ff_mov_obj_type
>
Thanks, I did not see this one. Added missing objecttypes.
> [...]
>
>> @@ -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
It is not 0. I just ensure that the codec exists before overriding.
Attached a fixed patch.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mp4_codecs_parser.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060211/f02f6a81/attachment.txt>
More information about the ffmpeg-devel
mailing list