2010年4月27日星期二

iPod video guide

Encoding videos suitable for iPods

Thanks to “cartman” on the FreeNode IRC network for testing and providing information for this guide.

The “new” higher resolution capability of the iPod video uses something Apple have dubbed a “Low Complexity” version of the Baseline Profile of H.264. Thankfully someone discovered what this meant. (See here for details – credit goes to Tyler Loch for this information.)

At first I wondered what the use of 640×480 video on a 320×240 screen would be but I was informed that these devices have a TV out. Fun. Anyway, on to the good stuff.

1.5Mbit/s 640×480 H.264 videos (for improved quality using TV out)
BIT_RATE <= 1500 kbps
640×480
Up to 30 fps
“Low-Complexity” H.264 Baseline Profile
1 reference frame
Up to H.264 level 3
640 pixels maximum frame width
Sample Aspect Ratio (SAR) must be 1:1
UUID atom must exist containing the following hex data: 6B 68 40 F2 5F 24 4F C5 BA 39 A5 1B CF 03 23 F3

For one pass:

ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec libx264 -vpre hq -vpre ipod640 -b BIT_RATE -bt BIT_RATE -aspect WIDTH:HEIGHT -threads 0 -f ipod OUTPUT.mp4

For two pass:

ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec libx264 -vpre fastfirstpass -vpre ipod640 -b BIT_RATE -bt BIT_RATE -aspect WIDTH:HEIGHT -threads 0 -f ipod OUTPUT.mp4

ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec libx264 -vpre hq -vpre ipod640 -b BIT_RATE -bt BIT_RATE -aspect WIDTH:HEIGHT -threads 0 -f ipod OUTPUT.mp4

768kbit/s 320×240 H.264 videos
BIT_RATE <= 768 kbps
320×240
Up to 30 fps
H.264 Baseline Profile up to level 1.3

For one pass:

ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec libx264 -vpre hq -vpre ipod320 -b BIT_RATE -bt BIT_RATE -metdata "title=SOME_TITLE" -threads 0 -f ipod OUTPUT.mp4

For two pass:

ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec libx264 -vpre fastfirstpass -vpre ipod320 -b BIT_RATE -bt BIT_RATE -metadata "title=SOME_TITLE" -threads 0 -f ipod OUTPUT.mp4

ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec libx264 -vpre hq -vpre ipod320 -b BIT_RATE -bt BIT_RATE -metadata "title=SOME_TITLE" -threads 0 -f ipod OUTPUT.mp4

IF ANYONE HAS FEEDBACK ON THE SETTINGS BELOW IT WOULD BE APPRECIATED!
2.5Mbit/s 640×480 MPEG-4 SP videos
BIT_RATE <= 2500 kbps
640×480
Up to 30 fps
Simple Profile

For one pass:

ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4 -trellis 1 -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -metadata "title=SOME_TITLE" -f ipod OUTPUT.mp4

For two pass:

ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4 -trellis 1 -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -metadata "title=SOME_TITLE" -f ipod OUTPUT.mp4

ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4 -trellis 1 -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -metadata "title=SOME_TITLE" -f ipod OUTPUT.mp4

http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/

没有评论:

发表评论