[Ffmpeg-devel] 640x480 iPod Baseline Low Complexity Profile

Tyler Loch tylerl82
Wed Sep 20 18:16:47 CEST 2006


Apple released a firmware update for 5G iPods last week, unlocking  
the 640x480 H.264 setting that the video chipset supports.

...unfortunately, they're trying to lock the iPod down into only  
playing Baseline Level 3 H.264 files created by QuickTime and iTunes  
- any file meeting their new hi-res specs produced by any other  
encoder is not allowed on the iPod, so says iTunes. Even QuickTime's  
own H.264 encoder isn't good enough. Only the unalterable iPod export  
preset.

Placing a 3rd-party-encoded (ffmpeg, x264, etc) Baseline Level 3 H. 
264 .mp4 into the iPod's file structure without using iTunes will  
allow the file to play perfectly fine on the iPod, so it's not a  
hardware limitation.

This is Apple's detailing of the specification:
H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per sec.,  
Baseline Low-Complexity Profile with AAC-LC audio up to 160 Kbps, 48  
kHz, stereo audio in .m4v, .mp4, and .mov file formats

"Baseline Low-Complexity" is something they made up. It basically  
means "Baseline with 1 reference frame".

After a weekend of trial, error, hex reading, and headaches, I  
learned the following:
Apple is using special tags to prevent iTunes from accepting 3rd- 
party-created .mp4 files.
This seems to be similar to the PSP limitations. I remember talk of  
adding a "-f ipod" option to movenc.c a few months back. It seems  
like a good idea to add it now...

Baseline Low-Complexity Profile Details:
1 reference frame.
No higher than Level 30.
640px is max width. No exceptions.
Must have a SAR. 1:1 is the correct setting.
Must have uuid atom with the following hex data: 6B 68 40 F2 5F 24 4F  
C5 BA 39 A5 1B CF 03 23 F3

^^ that uuid atom is crucial. If it's removed (or altered) in a known- 
working QuickTime-created file, iTunes will refuse to place it on the  
iPod.

I've been able to edit libavcodec/x264.c and libavformat/movenc.c  
with a special SAR value and uuid atom creator that creates .mp4  
files that iTunes on Mac OS X accepts, and play perfectly on the 5G  
iPod.

My experience with C code is best described as "none", so please  
don't consider these diffs ready to commit. In fact, the profile  
details listed above are probably better to follow. Someone competent  
should review these snippets for inspiration. Sorry I can't be more  
thorough.

movenc.c
This adds the uuid atom (albiet malformed) to any H.264 video that is  
not forced to PSP format. The PSP would play the "unsupported data"  
game if it's present.
?

x264.c
This hack hardcodes a SAR of 1000/1001. Close enough to 1:1 to not  
matter, but different enough to force adding a SAR value to the file.
This is an idiotic way to do it, as the SAR should be added in movenc.c
?

This is a working file with the extra metadata added:
http://www.techspansion.com/visualhub/ipod-h264640.mp4

Syncs to iPod on Mac OS X (PPC/Intel). iTunes on Windows doesn't seem  
to like it still.

-Tyler Loch
Techspansion LLC
http://www.techspansion.com






More information about the ffmpeg-devel mailing list