[FFmpeg-devel] [PATCH] add uuid box to MP4 to make h.264 play on iPod

Michael Niedermayer michaelni
Sat Feb 23 17:16:19 CET 2008


On Sat, Feb 23, 2008 at 12:14:43PM +0000, Mark Himsley wrote:
> ?smail D?nmez wrote:
>> Hi again,
>>
>> On Sat, Feb 23, 2008 at 12:36 PM, Mark Himsley <mark at mdsh.com> wrote:
>>   
>>>  Index: libavformat/allformats.c
>>>  ===================================================================
>>>  --- libavformat/allformats.c    (revision 12120)
>>>  +++ libavformat/allformats.c    (working copy)
>>>  @@ -131,6 +131,7 @@
>>>      REGISTER_MUXDEMUX (PCM_U16LE, pcm_u16le);
>>>      REGISTER_MUXDEMUX (PCM_U8,    pcm_u8);
>>>      REGISTER_MUXER    (PSP, psp);
>>>  +    REGISTER_MUXER    (IPOD264, ipod264);
>>>     
>>
>> This list is alphabetically sorted, don't break that.
>>
>>   
> Golly, should have spotted that. Oops.
> A new patch addressing your issues is attached.

[...]
> @@ -541,6 +542,20 @@
>      return tag;
>  }
>  
> +// uuid atom to make file play in iPods running newest firmware
> +// goes after avcC atom in moov.trak.mdia.minf.stbl.stsd.avc1
> +static int mov_write_uuid_tag_ipod(ByteIOContext *pb)
> +{

this comment is not doxygen compatible


[...]
> -    else if(track->enc->codec_id == CODEC_ID_H264)
> +    else if(track->enc->codec_id == CODEC_ID_H264) {
>          mov_write_avcc_tag(pb, track);
> +        if(track->mode == MODE_IPOD)
> +            mov_write_uuid_tag_ipod(pb);
> +    }

Why is this h.264 specific?


[...]
> @@ -1454,6 +1472,7 @@
>          else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3G2;
>          else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
>          else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
> +        else if (!strcmp("ipod", s->oformat->name)) mov->mode = MODE_IPOD;

Please keep the stuff nicely aligned vertically.


>  
>          mov_write_ftyp_tag(pb,s);
>          if (mov->mode == MODE_PSP) {
> @@ -1710,3 +1729,19 @@
>      .codec_tag = (const AVCodecTag*[]){codec_3gp_tags, 0},
>  };
>  #endif
> +#ifdef CONFIG_IPOD_MUXER
> +AVOutputFormat ipod_muxer = {
> +    "ipod",
> +    "iPod H.264 mp4 format",
             ^^^^^
> +    "application/mp4",
> +    "mp4",
> +    sizeof(MOVContext),
> +    CODEC_ID_AAC,
> +    CODEC_ID_MPEG4,
                ^^^^^

this looks odd


> +    mov_write_header,
> +    mov_write_packet,
> +    mov_write_trailer,
> +    .flags = AVFMT_GLOBALHEADER,
> +    .codec_tag = (const AVCodecTag*[]){ff_mp4_obj_type, 0},
                                          ^^^^^^^^^^^^^^^
Are they all supported? if not please create a seperate list with just the
ones supported!


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080223/0df8e887/attachment.pgp>



More information about the ffmpeg-devel mailing list