16x frame sizes redux

My last post on Influxis discussed the importance of using video frame dimensions for Flash Video that were multiples of 16. For example, 320×240 has a width and height divisible by 16, without any remainder. The 16x factor is important for optimal playback with both the On2 VP6 and Sorenson Spark codecs available in the FLV file format and Flash Player.

But what happens if you have a source video file with dimensions that are not 16x? I’ll give you an example that happened recently with a client of ours at [theMAKERS]. The client provided us with a high-quality MPEG-4 file having a video dimension of 720×480. This resolution is a non-square pixel aspect ratio, and when played/converted to a square pixel display such as a computer monitor, is 640×480. 640×480 is a perfect 16x resolution, but the video included a letter-boxed frame. (Letter-boxing is the addition of black bars above and below the video image, usually added when 16:9 aspect ratio film/video footage is being played back on a 4:3 aspect display like a standard definition (SD) television. You’ve probably noticed letter-boxing on widescreen DVD titles you’ve played on your old non-HD TV set.) Encoding the black areas of a letter-boxed just eat up valuable bitrate for video deployed over the Internet. The best practice is to crop the any letter-boxed area from the source video before encoding to another web-ready format. I prefer to use Adobe After Effects CS3 to do any video resizing, cropping, or deinterlacing. After I created a composition in After Effects and cropped out the letter-boxing, the final frame size was not a nice 16x resolution: 630×424. (BTW, to retain quality with the cropped output from After Effects, I used the super nice BitJazz SheerVideo codec. I talk about this codec in a Community MX tutorial.) Neither the width or height of this resolution is 16x friendly. So what’s a professional Flash Video expert supposed to do? The best solution is to slightly stretch the video’s dimension to the nearest 16x neighbor. Here’s a Flash movie I built that shows the 16x sizes from 96 to 2000 pixels:

Based on this table, you can see that the closest 16x resolution to the width of 630 is 624 and to the height of 424 is 432. I proceeded to use this resolution in my FLV Bitrate Calculator to build an appropriate FLV file. I also needed a lower resolution FLV file to target a lower bitrate, and came across another problem: the quarter resolution of 624×432, which is 312×216 is also not a 16x friendly resolution. I could have used the same stretch concept to go to 320×224, but that’s even more stretching upon the original 630×424 resolution. A better solution is to calculate a quarter of the original resolution, which is 315×212, and stretch from there: 320×208. So, in summary, always strive to use a 16x size for your Flash Video (FLV) content, even if you need to slightly stretch the dimensions of your source video. The distortion to the video image will not be noticeable in the final output. You can view the FLV content mentioned in this post at the client’s site, http://www.vermilionpictures.com/hearandnow. Click the small or large text link for the “View the Trailer” area at the top right corner of the Flash site.

  • http://n/a Andy Lewis

    Hi Robert,
    Thankyou very much for your talk at FOTB’07 on your FlashBitrateCalculator and multiples of 16.

    Im stick stuck however on FPS rates for encoding FLV’s.

    Is there a golden rule also for this?
    Should the flv FPS be the same as the .fla framerate?
    Should the flv FPS be the same as the source video ie PAL 25, NTSC 24 ?

    Thanks in advance!

    .andy.

  • derek martin

    Hey Robert,
    Thanks for the great tools and continued knowledge on flash video. I had a question about computer monitors “playing/converting” the 720X480 video as 640X480. I have a handle on the idea that the pixel widths are different, I guess i just did not see it in the quicktime movies. If they have already been captured using the apple (default dv?) blackmagic codec and are 720×480 .mov(s) does that mean i prepare them for the web as if they were 640×480? Any thoughts much apppreciated…
    derker

  • http://www.monsonmedia.com/blog/?p=50 theHUB » Blog Archive » Optimal Flash FLV Sizes

    [...] I’ve embeded a chart below that lists all suitable dimensions that are multiples of 16 (courtesy of Influxis Labs): [...]

  • http://www.on2.com/blog/2009/02/vp6-video-encoding-tips/ VP6 Video Encoding Tips | On2 Video Compression Blog

    [...] explanation of the practical reasons, as well as a helpful table of sizes, see Flash kung fu master Robert Reinhardt’s post at Influxis [...]

  • http://felixtrinidadboxingsite.wordpress.com/2009/12/14/felix-trinidad-boxer-news/ Alexis

    Hi!. Thanks a bunch for the blog. I’ve been digging around for info, but there is so much out there. Google lead me here – good for you i suppose! Keep up the good work. I will be popping back over in a couple of days to see if there is updated posts.

  • http://www.boxeeboxes.net Temeka Youngblut

    Pleasant work! I may not understand or go along with all the things on this page, nevertheless it still is particularly valuable material! I most likely ‘m going to devote the next couple of weeks simply just browsing through your further blog posts. Farewell for the moment.

  • http://www.docstoc.com/docs/58636846/Comus-Inn-at-Sugarloaf-Mountain comus inn

    A mutual acquaintence sent me the url to your blog. Glad I listened to him! I like how you really dig in and get to the bottom line but can you run through that last part again? Just a bit? –Jessie

  • http://pc-monitors.net/best-computer-monitors/ best computer monitor 2010 led

    best computer monitor 2010 led…

    [...]16x frame sizes redux « Influxis Labs[...]…


logo