Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

H264 for iPod may be larger than 320 pixels wide System
As the MPEG4 limit for iPod encoding is 480x480 (230,400 pixels) and one may alter the ratio as long as the pixel limit is respected (640x360 is also okay), I wondered if the same "pixel limit" held true for H264 (320x240 = 76,800 pixels total). In other words: Would an H264 width larger than 320 pixels be accepted by the iPod as long as the width times height was no more than 76,800 pixels?

I'm really pleased to report that this works fine. I used ffmpegX (9uR2) to convert an AVI over to "iPod H264" last night. As the title was in widescreen format, I played with my calculator a bit until I came up with 416x176 as matching the original ratio. 416x176 = 73,216 pixels -- under the 76,800 pixel limit.

In order to maximize the quality (and still keep the file size reasonable), I used 450KBps, Qmin:3, Qmax:30, Keyframe:20, Audio:96kb, ME function: Multi-hexagon. I use "Decode with QuickTime" all the time simply because it works all the time. Other checkboxes are left as is.

The 1:24:00 file ended up at 332MB and, at H264's quality, is a substantial improvement over an MPEG4 encoding at the same pixel size, or even a considerably larger pixel size. It's also considerably better than if I had used 320x144 (the closest acceptable width to the movie's original ratio). Do the math: 320x144 = 46,080, or 63% of the 73,216 pixels I had in my final file.

By the way, the method I use to drop my video files into my iPod is just that: Drop the file directly into the iPod within the iTunes interface (not the mounted iPod in the Finder). The file never exists in my iTunes Library. Some folks are reporting issues copying from the iTunes Library to the iPod with the 6.0.2 iTunes and the latest firmware update. Using this method, I have no problems.

[robg adds: This previous hint seemed to indicate that H.264 would not work. Since I don't have a Video iPod to test with, I thought I'd run this one as a new comment so that the info is out there, in case it does work...]
    •    
  • Currently 3.00 / 5
  You rated: 5 / 5 (4 votes cast)
 
[15,172 views]  

H264 for iPod may be larger than 320 pixels wide | 10 comments | Create New Account
Click here to return to the 'H264 for iPod may be larger than 320 pixels wide' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
H264 for iPod may be larger than 320 pixels wide
Authored by: stephanos on Jan 19, '06 07:47:12AM

Formula for calculating video size:

x=sqrt(76800*r)
y=x/r

Where r is the aspect ratio (e.g. for 16:9 it's 16/9), x is the pixel width and y is the pixel height. If you round down to integers, for 16:9 video it comes out to 369x207 = 76383 pixels, though 370x207 and 369x208 also come out to less than 76800.

This is where I recommend the excellent FormulaCalc widget - the only Dashboard calculator you'll ever need.

As to what that looks like on an HD screen, I'll leave that for someone who can afford the hardware to find out :-)



[ Reply to This | # ]
FormulaCalc Issues
Authored by: richardab on Jan 19, '06 09:48:24AM

I just downloaded FormulaCalc from the German website. But how do you do the square root? I tried X^(1/2) but that only yielded X. In fact how do you do exponents? Because 9^2 yields 11 not 81. It seems like a nice widget but not very powerful if it can't do exponents. Maybe I'm just using old school notation or they use different symbols in Germany.



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: lstewart on Jan 19, '06 09:51:24AM

Obviously video at this size will have to be scaled to play back on the iPod itself. And while the iPod is capable of this video scaling, some people have reported smoother playback of scaled videos when the resolution is evenly divisible by 16. While the original poster's 2.35:1 aspect ratio suggestion of 416x176 fits this suggestion, the formula suggested here does not.

My question is: I think I read about the divisible-by-16 rule as it was being applied to MPEG4 video. Can anyone confirm whether it applies to H.264 as well? Will odd-pixel-sized H.264 scale smoothly for playback on the iPod? (Or are there flashing/flickering/choppy artifacts during playback?)



[ Reply to This | # ]
iPod-Video-Podcast with chapters
Authored by: claudio on Jan 19, '06 10:44:39AM

OFF-TOPIC:
Has there anyone been able to create a video-podcast with chapters with another software than Apple's latest iMovie HD?
Probably with ffmpegx and some other tool?
If yes, have you been able to select the chapters while playing the video-podcast on the iPod (i.e. by clicking the FWD / BWD buttons).
I'm heavily looking for an opportunity to do that.
Regards,
Claudio

---
- claudio



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: azguy on Jan 19, '06 02:40:34PM
Strictly speaking, it's not the number of pixels that's the ultimate limit --- it's the number of 16px-by-16px "macroblocks" the image has: MPEG-4: You get 900 macroblocks H.264: You get 300 macroblocks This isn't to say that all resolutions must be divisible by 16 (they don't need to), but it is to say that partial macroblocks count as whole ones. There are dimensions that satisfy the (incorrect) total pixel limit, but violate the macroblock rule... they don't work.

[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: Gutta on Jan 20, '06 02:31:38AM

<blockquote>I used 450KBps, Qmin:3, Qmax:30, Keyframe:20, Audio:96kb, ME function: Multi-hexagon. I use "Decode with QuickTime" all the time simply because it works all the time. Other checkboxes are left as is. </blockquote>

I can <b>confirm</b> that the iPod video will play a movie at 416 x 176 pixels, but the aspect appears completely wrong to me, but that may be something to do with the source I'm feeding it (16:9 anamorphic) - I'll tweak the pixel count and see what I come up with. Also, isn't it a bot of a waste sampling the audio at 48kHz? 44.1 would be adequate.

Where did you find the Keyframe :20 parameter? I can't find where it is.

And lastly, I've been trying to drop the file directly onto my iPod in the iTunes interface as suggested, but it won't work for me. Firmware 1.1 and iTunes 6.0.2. ANy ideas?

Thanks for the tip, Gutta



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: GlowingApple on Jan 20, '06 10:58:05AM

Correct me if I'm wrong, but I believe you have to have Music set to manual or just Videos set to manual to drag and drop, otherwise the iPod will only sync what's in your library.

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: barryjaylevine on Jan 25, '06 10:47:23AM

I just realized that my hint was posted so I'll try to answer some of the Q's and comments that readers have posted.

16 pixel "increments" - Yes, it's always a good thing to keep both the width and height in increments of 16. Come as close to the proper ratio as you can but do keep to the "16's".

kbps - ffmpegX usually suggest in the 175-270 range depending on the pixel size I spec. I normally bump that up to 450-500kb to maximize quality.

Qmin:3, Qmax:30 - these are absolutely necessary if you are going to go to the trouble of creating H264 content that you intend to play on your iPod and watch on your TV. It increases the size of the file but dramatically improves the resulting image.

Max GOP Size (in Options within ffmpegx) - Frankly, I don't know where I came up with the lower number (lower than the default of 250) but it seemed to me that using a lower number would produce a complete frame containing all of the picture data more often and that this would produce a better end product. I may be totally wrong here.

ME Function: Use Multi-Hexagon or Exhaustive to improve quality. Yes, this adds a bit to the encoding time but, if you're going to this trouble...?

Scaling: Yes, going up from 320x (or higher, if possible) to 480 results in some loss of quality but that's the price of entry into H264 for iPod. There will probably be another iPod that will support H264 at 640x (and probably at the HD resolution if you read anything into what Steve Jobs has been saying), but that's another thread, eh?

Remember that my purpose in doing this is to display the video on my TV from my iPod. Should you only want to watch on your iPod, the default settings in ffmpegX (H264 iPod) are fine.

By the way, what does one save in MB by doing this process as opposed to using "plain old" MPEG4 which, if the ratio supports it and the 230,000+ pixel limits is respected, can be 640x? Your mileage may vary but I find the savings to be about 25%-35% given equal quality (and I'm measuring quality simply by how good it looks to me on my 32" Toshiba CRT TV).

Finally (and this may really start some discussion), I think this method (converting videos from legitimate sources to iPod format for playback on my TV) is good enough to eliminate any desire for one of those 61" LCD behemoths and certainly any need for BluRay or HD-DVD. As far as I'm concerned, both of the formats can go pound sand. Please note that my reasoning is not a claim that "iPod to TV" is anywhere near the quality that BluRay and HD-DVD can achieve - in fact, even current DVD technology is way better; rather, it's that my needs for video entertainment are met with much lower technology. My 20th Century TV works great and, though a digital cable box might be needed in a few years, I'm fine with 640x480 (or letterbox) presentation.

Perhaps BluRay and HD-DVD are answers to a question no one has asked?

---
-----
Two things in this world aren't overrated: Macintosh and Lemon Meringue Pie.



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: barryjaylevine on Jan 25, '06 07:34:13PM

re: Scaling. I should have written:

Scaling: Yes, going up from 320x (or higher, if possible) to 640x ...

---
-----
Two things in this world aren't overrated: Macintosh and Lemon Meringue Pie.



[ Reply to This | # ]
H264 for iPod may be larger than 320 pixels wide
Authored by: AdamF_MacGuy on Feb 22, '06 11:32:09AM
Below is a guide for saving H264 and MPEG4 movies at higher video resolutions based on their aspect ratios for viewing on iPod Video

MPEG4 Aspect Ratio Resolutions*
*(230,400 Pixels Max)

720 x 304 - 2.35:1 (Anamorphic = thicker letterbox bars)
624 x 336 - 1.85:1 (Academy Flat = thinner letterbox bars)
624 x 352 - 1.78:1 (16x9/U.S. Digital Television = thinest letterbox bars)
512 x 384 - 1.33:1 (4x3/NTSC Analog Television = no letterbox bars)

H264 Aspect Ratio Resolutions*
*(76,800 Pixels Max)

432 x 176 - 2.35:1 (Anamorphic = thicker letterbox bars)
368 x 192 - 1.85:1 (Academy Flat = thinner letterbox bars)
368 x 208 - 1.78:1 (16x9/U.S. Digital Television = thinest letterbox bars)
320 x 240 - 1.33:1 (4x3/NTSC Analog Television = no letterbox bars)

If you need help deciding what aspect ratio the video content was created in, this site has a lot of useful info... Widescreen-O-Rama
Also, all resolutions listed above conform to the macroblock units previously discussed (in order to avoid screen flickering).

Hope this helps.

[ Reply to This | # ]