[Ffmpeg-devel] Re: [PATCH] mp4 codecs objecttype handling (original) (raw)
Baptiste COUDURIER baptiste.coudurier
Sat Feb 11 14:30:40 CET 2006
- Previous message: [Ffmpeg-devel] [PATCH] mp4 codecs objecttype handling
- Next message: [Ffmpeg-devel] Re: [PATCH] mp4 codecs objecttype handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 mp4codectags[] = { + { CODECIDMPEG4 , 0x01 }, /* MPEG4 Systems 1 */ + { CODECIDMPEG4 , 0x02 }, /* MPEG4 Systems 2 */ + { CODECIDMPEG4 , 0x20 }, /* MPEG4 */ + { CODECIDAAC , 0x40 }, /* MPEG4 Audio */ + { CODECIDMPEG2VIDEO, 0x60 }, /* MPEG2 Simple */ + { CODECIDMPEG2VIDEO, 0x61 }, /* MPEG2 Main */ + { CODECIDMPEG2VIDEO, 0x62 }, /* MPEG2 SNR */ + { CODECIDMPEG2VIDEO, 0x63 }, /* MPEG2 Spatial */ + { CODECIDMPEG2VIDEO, 0x64 }, /* MPEG2 High */ + { CODECIDMPEG2VIDEO, 0x65 }, /* MPEG2 422 */ + { CODECIDAAC , 0x66 }, /* MPEG2 AAC Main */ + { CODECIDAAC , 0x67 }, /* MPEG2 AAC Low */ + { CODECIDAAC , 0x68 }, /* MPEG2 AAC SSR */ + { CODECIDMP3 , 0x69 }, /* MP3 */ + { CODECIDMPEG1VIDEO, 0x6A }, /* MPEG1 Video */ + { CODECIDMP2 , 0x6B }, /* MPEG1 Audio */ + { CODECIDMJPEG , 0x6C }, /* JPEG Video */ +}; duplicate of ffmovobjtype
Thanks, I did not see this one. Added missing objecttypes.
[...]
@@ -650,12 +671,22 @@ static int movreadesds(MOVContext *c,
len = movmp4readdescr(pb, &tag); if (tag == MP4DecConfigDescrTag) { + enum CodecID id; + sc->esds.objecttypeid = getbyte(pb); sc->esds.streamtype = getbyte(pb); sc->esds.buffersizedb = getbe24(pb); sc->esds.maxbitrate = getbe32(pb); sc->esds.avgbitrate = getbe32(pb); + id = codecgetid(mp4codectags, sc->esds.objecttypeid); + if (id >= 0) { + AVCodec *codec; + codec = avcodecfinddecoder(id); + if (codec) + st->codec->codecid = id; + } wth is this supposed to do? why not: if(st->codec->codecid <= 0)_ _st->codec->codecid= codecgetid(mp4codectags, sc->esds.objecttypeid);
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>
- Previous message: [Ffmpeg-devel] [PATCH] mp4 codecs objecttype handling
- Next message: [Ffmpeg-devel] Re: [PATCH] mp4 codecs objecttype handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]