Archive for February 7th, 2008

General A/V compression guidelines

This is a generic tutorial on audio/video compression. It does not adhere to any specific application, but it teaches you what is what, so by using this knowledge you can export from ANY application in the market. So, here’s what you need to know:

* Many video editors require that you “tell them” in their project properties what kind of source footage you got. For example, if your source footage is NTSC HDV, you need to tell them to accommodate/optimize for 1080/60i. For PAL that would be 1080/50i. Then there is 24p footage, different resolutions, or plain DV or just digicam VGA video. You must always know what kind of source footage your camera outputs, so you can configure your video editor or utility to accommodate it. For example, if your camera shoots HD at 24fps and you let your video editor to use the default DV in a 60i timeline, you will get bad quality, and performance degradation during editing. So, get it right! Not all editors automatically recognize your source footage and auto-configure themselves.

* If you are using Sony Vegas, I would recommend you right click on clips in the timeline that lots of motion, select “Properties” and then “Disable Resample”. This will get rid of the “ghosting” effect during the final export. Not sure how to do that on other video editors, most of them don’t have the ability to turn it on/off.

* When you are finally ready to export, the first thing you need to decide is the medium you want to export to. Is it the web, the iPod, the PS3, a DVD, or simple archival? You see, depending the device you want to export for, different codecs and options apply. Here are some basic codec guidelines for some popular devices:
– iPod: 320×240 resolution, native frame rate as source footage, h.264 video codec 512 kbps, AAC audio codec 64 kbps stereo.
– Sony PS3 and XboX360: 1280×720 or 1920×1080 resolution depending if you have a 1080p or a 720p TV, native frame rate as source footage, h.264 or WMV or XViD video codec at 5 or 9 mbps, AAC audio codec 128 kbps stereo or 5.1 surround.
– DVD: use the DVD templates that video editors usually come with.
– Youtube: Same as iPod.
– iPhone and PSP: Same as iPod, but at 480×270 resolution at 1mbps bitrate.
– Vimeo SD and HD: Tutorials here and here.
– Zune and Creative players: 320×240 resolution, native frame rate as source footage, WMV video codec 512 kbps, WMA audio codec 64 kbps stereo.
– Archos and other PMPs: 320×240 resolution, native frame rate as source footage, XViD video codec 512 kbps, MP3 audio codec 64 kbps stereo.
– Archival: a lossless or near-lossless codec, like DV, HDV, mjpeg, Huffyuv, Lagarith, Cineform, ProRes, AIC etc.

* Video codecs. There are two kinds of codecs. The Delivery grade codecs and the Intermediate grade codecs. The first ones are supposed to be exporting/view-friendly, and the other ones archival/editing friendly. More information here on the subject. I would suggest to hunt for h.264 video, AAC audio, inside the .mp4 container format. That’s the most compatible and widespread format today on devices.

* Frame rate. Keep frame rate the same as the source footage (you should be able to find some “summary” information about your footage somewhere on your application). For NTSC that would be 29.97 (60i), for PAL 25 (50i), and then there’s 24 progressive frames, which actually in reality is 23.976 fps. I would suggest you export with the right frame rate each time and not round these weird numbers to 30.00 or 24.00.

* Resolution. When you export, depending on the camera you got, here are your resolution options and bitrate you should be exporting at with delivery-grade codecs:
NTSC DV 4:3: 656×480 or 640×480 (at 1800 kbps)
PAL DV 4:3: 768×576 (at 2300 kbps)
NTSC 16:9: 874×480 or 880×480 (at 3000 kbps)
PAL 16:9: 1040×576 (at 4000 kbps) or 880×480 (at 3000 kbps)
HVX or DVX 16:9 DV Panasonic cameras, export at 848×480 or 852×480 (at 3000 kbps)
AVCHD/HDV: 1920×1080 (9 mbps) or 1280×720 (5 mbps)
Canon TX1 or Kodak 720p digicams: 1280×720 (5 mbps)
Digital camera VGA 4:3: 640×480 (at 1800 kbps)
Please note that you should never export for web/viewing purposes with aspect ratios that are not 1.0000. I see a lot of people for example exporting DV at 720×480 or 720×576, but this is not the safe thing to do, because most applications don’t take into account the special aspect ratio value that these kinds of exports have, and so you end up with squashed heads. Use the above guide to get it right, and make sure that aspect ratio is set to either 4:3 or 16:9 for the above resolutions, or at aspect ratio 1.0000 if your application uses this way to represent pixel information.

* Bitrate. Bitrate is the amount of bits per seconds that the video uses. That’s the only factor that decides how big a video file will be or not. There are two kinds of bitrates: constant and VBR. In constant bitrate, you just tell the application to use a specific number of kbps or mbps, as shown above. But in VBR, you give two numbers: one for the average number and one for the peak number. For example, if you want an average bitrate of 3mbps, you can also ask the application to have a peak number of 5mpbs. The application will go as high as 5mbps only when there is a lot of motion on the scene and it requires more bits to encode it properly, while it will stay at 3mbps or below if the image is static and doesn’t require lots of bits. VBR is generally preferred for best quality, but it’s more difficult to figure out, if the application’s user interface is not well done.

* De-interlacing. If your camera does not shoot in progressive mode (most camcorders don’t, only digital cameras do), then you must de-interlace during export, otherwise your video will have “jaggies” (horizontal lines). You must hunt for a checkbox or option that’s called “de-interlacing” or “progressive”. Please note that if you are exporting in an intermediate format for editing/archival reasons, or back to the camera’s tape, you should not be exporting as progressive, because this is not the footage’s native format. Only de-interlace for “viewing” purposes, e.g. youtube, ipod etc.

* Audio bitrate. For audio select between 64kbps to 128 kbps (although you can have VBR for audio too). More than that is usually goes unused by many devices/headphones, so there’s no reason to use more. Use 44.100 Khz for sample rate, and Stereo.

* Audio Codec. Like with the video codecs, there are many different audio codecs you can choose from. But the audio codec should always be decided in conjuction to the video codec. For example, if you want to export in h.264 Mpeg4, you must use AAC, because that’s the way most players are optimized to read h.264 with. For DivX/XViD it’s mp3. For Theora video it’s Vorbis audio. For WMV it’s WMA, and so on.

* Containers. Don’t confuse “containers” with “codecs”. MOV and AVI are *not* codecs, so saying that “I exported as AVI” says nothing to others who might try to debug your problem. AVI/MOV are simply file formats that inside them can “host” actual video and audio codecs. In theory, you can have a gazillion different codecs in them, it’s just a container format to keep “glued” the different kinds of audio and video together…


Someone said that I am rude (not the first time, of course). Thing is, I am rude in general. But NOT on the specific case. But people always have prejudice against others and they over-read comments in the future if they have caught you once to actually be rude.

But despite that, I won’t stop being who I am and always second-thinking every move of mine just so I make sure I don’t get misunderstood again in the future. That would just not be honest. And if I am one thing for sure, that’s “honest” (no, not “self-righteous bitch”).

My “straight-forwardness” and “to the point” comments towards others often puts me in trouble, but I believe this is my best quality. If you look like a stuffed potato in your new dress, be assured that I will be the one to point it out to you point blank, and I’d do that exactly because I care. Would it “suck the fun out” of it? It probably would. But at least you get one person who’s not afraid to be honest with you and not laugh behind your back.

WGA strike is over

A deal has been struck between the major media companies and the Writers Guild of America to end the writers’ strike, former Walt Disney chief executive Michael Eisner revealed on CNBC.

Now the only question I have is how many “Lost” episodes will be shot for this season (there are 8 that are already done). To go back at the field and shoot it requires 4 to 6 weeks. Then, it requires 2 weeks to actually shoot, per episode (although multiple episodes are usually worked on at the same time). Then it requires at least 1-2 weeks of post-processing.

Overall, we are looking for at least 2 months time before a new episode is ready for broadcast. This means that if the crew starts working this coming Monday, the first new episode (9th of the season) would be ready around 10th of April. Given the fact that “Lost” plans were for 16 episodes this season, the season’s finale will have to be pushed to 12th of June (Thursday). And this is up to ABC if they want to push their series so far into the summer when viewership is down, or cut the number of new episodes, or have a two-hour finale. Hopefully, they will allow “Lost” to have all its 16 episodes this season, as planned.

Regardless, don’t forget to watch the 2nd episode tonight. It’s an exciting episode, I hear.

The first alien-human hybrid is a success

Perez calls Victoria Beckham “alien spice” and he’s got a point. She reminds me of the Greys too. Creepy.


Madonna’s daughter, Lourdes, looks great. In fact, she looks exactly like her mom. She has the same smile as Madonna used to have as a youngster. I am impressed in the way Madonna is raising her children. Lots of education (Lourdes speaks 3 languages flawlessly, already), little TV, no junk food. Hopefully she doesn’t inject them with B12 though as she does to herself.