Been fielding requests for recommendations on video formats, encoding, and compression? There's no simple answer, but maybe I can give you a starting point you can use with your upstream clients and their agencies.
Firstly, I'm assuming its given that Flash Player will be the video delivery platform. A Flash based video player can handle various encodings, any number of dimensions of the player window, and a variety of assorted options. If you're in any doubt about cobbling together your own player, be sure to check out the tremendous JW Video Player.
So my recommendations are just that -- recommendations. They do not constitute any specific limitation of the platform. And no doubt folks will disagree with some of my musings. I'm trying to put forward a simple set of rules for video tyros faced with the task of getting existing video onto their web sites.
Video encoding and the file format are limited to the version of Flash Player (FP) you are accepting as the minimum for your web site.
- FP6-7: Sorensen Codec
- FP8: On2 VP6 Codec
- FP9: h.264
- FP6-8: FLV
- FP9: FLV, MP4
h.264 encoding with MP4 is the best file format. Apart from fabulous quality, it can also be downloaded and played using desktop video players like Quicktime. I think it's important to offer an offline version of content these days for desktops, iPods and other devices.
Recommendation: FP9 with MP4 using h.264 codec
So far, so good (as long as you ignore the controversy of forcing users to upgrade to the latest Flash Player). The problems start when you need to consider file size versus video quality. The higher the quality the higher the file size. If you're in charge of preparing the video, you really need to make a judgement call on each piece of content. Web video production needs to strive for the smallest file size for the best acceptable quality.
If you are not in control of the production quality, and your upstream agencies are lazy then the only thing you can dictate beyond encoding is the file size limit. I would recommend you tell folks you require the best possible video quality that fits within 10 megabytes. Anything above 10Mb and many of your consumers are going to struggle with progressive downloads.
Last but not least you need to consider the dimensions of the video player. Something like the JW Video Player implementation doesn't actually care. If you nominate to play a video of larger/smaller dimensions in a smaller/larger player window it will scale the video accordingly. Obviously if you can agree on a limited number of accepted player dimensions then post-production on the video can target a specific player size and so guarantee the best quality free of scaling.
I like the following player dimensions:
- 425px X 355px for pillar box
- 640px X 358px for widescreen (16:9)
The pillar box size is taken from the default YouTube size. The 16:9 the width that fits nicely into many 1024x768 web designs.
With respect to compression and bit rates -- there is no magic formula. Here is a snippet from a tutorial on the subject, by the guy who put together the JW Video Player. Producing good quality video at the smallest file size is still somewhat of a black art.
"I always use the 2-pass VBR converter (except for rough tests). It takes the most time, but gives the best performance. I use a keyframe for every 2 seconds (50 frames) for video with little motion up to a keyframe every half second (10 frames) for video with a lot of motion. Bitrate for the video: 200 - 1000 kbps, again depending on the amount of motion in the source material. Just try it and if it looks good, try a lower bitrate until the quality starts to decline. My audio is set to 32, 64 or 96 kbps mp3. 32 for just speech, 96 for cool music. Again, listen if the sound starts to lose crispness. Remember that a byte is not a bit! A byte is 8 bits .."
If you have an agency asking you for the "bit rate" without any reference to the actual content, they're not really doing their job. If you are desperate throw out the number 300kbps and a handful of fairy dust.
Video Format Recommendations
If the agencies are not going to provide proper quality checks then we can at least force them into the following basic recommendation:
- must be MP4
- must be h.264 encoded
- fits 425px X 355px for pillar box
- fits 640px X 358px for widescreen (16:9)
- best quality (or 300kbps for the desperate)
- must be less than 10Mb in size
You may find you have circumstances where you need to vary these recommendations. For example, the video quality is shocking under 10Mb. You can always have larger video file sizes. For now, put this up as a straw man, see what feedback you get and adjust accordingly.