Archive for October 30th, 2007

Ratings

I don’t know what to think about it anymore. “Heroes” ratings go from bad to worse (and I believe that the second season is better than the first). It now has fewer than 9 mil viewers, while last year it was steady at around 12-14 mil. And then, you have crap like the medical dramas or “CSI:Miami” riding the ratings train with 16-18 min viewers (did you see the last episode where a ghost helped the detectives? how laughable was that?).

This means two things:
1. Either the vast majority of humans are boring idiots who prefer old style dramas, or…
2. Most young viewers are getting their episodes from Bittorrent/DVR and so the Nielsen ratings are inaccurate.

I think the truth is somewhere in between. I have noticed that dramas that get high ratings and many millions of viewers (e.g. medical dramas, CSI, Desperate Housewives etc), they have very few comments on IMDb — compared to shows like “Lost” or “Heroes”. It is my understanding that the people who view these shows are just older people, who are used to a specific style. Young people, are more active online and more fanatic about their favorite series, but they don’t necessarily view the episodes on TV when they air. And this hurts their favorite series ultimately, like it happened with “Jericho”. Now, it’s “Heroes” time to get hurt… Possibly “Lost” is next.

Understanding Pixel Aspect Ratios

Aspect ratios is possibly the most confusing matter in video editing for many videographers. There are a number of tutorials online about it that make the matter even worse with their PAR/DAR/SAR terminology, but I will try to present the problem as simply as possible, and in regards to PC monitors and web exporting instead of TVs.

So, in a nutshell, aspect ratios allow you to “stretch” videos during playback using that aspect ratio number as a guidance as to how much the video should be stretched. So for example, both the NTSC Standard 4:3 and NTSC Widescreen 16:9 resolutions are 720×480. And for PAL both are 720×576. What’s different between Standard and Widescreen is the pixel aspect ratio regarding their horizontal size. You see, by default, consumer widescreen cameras are shooting squashed! So while the 480 or 576 lines/pixels never changes, the horizontal number does — it stretches out in order to not looks squashed. These videos that are supposed to stretch out when played back are called “anamorphic” videos.

On NTSC for example, the DV Widescreen aspect ratio is set by the DV consortium as 1.2121. If you take NTSC resolution of 720×480 and you do a 720*1.2121 you will end up with a number that’s 873. And that’s the actual rendered resolution of the DV Widescreen on a PC monitor: 873×480. That’s how many pixels of your screen will be used to display your DV footage, even if the actual resolution that was shot by the camera was 720×480. The Europeans are a bit luckier, they have higher resolutions (720×576) and different aspect ratios (1.4568). So for PAL DV widescreen it’s 720*1.4568=1049 and that creates an overall playback surface of 1049×576. These calculated “playback resolutions” (as opposed to “as shot resolutions”) now are said to have a pixel aspect ratio of 1.0000.


Sony Vegas project properties

Different delivery formats have different aspect ratios, so you always need to calculate them manually. For example, NTSC DVDs (after you apply their aspect ratio calculation over their original resolution) are 853×480, not like DV’s 873×480. SVCDs, VCDs and HDV have their own aspect ratios too and they create a different playback resolution surface on a PC monitor when played back. If you are exporting for the TV instead, just use your application’s pre-configured templates to deal with that. For example, Vegas knows how to export with the right aspect ratios for DVDs. However, if you are exporting for the web, then you need to pay major attention in what resolutions you export, especially if you shot in widescreen mode.

Let’s say you want to export in h.264, or mpeg4 or WMV. Let’s also assume that you shot in widescreen NTSC. If you want to export using the full rendered resolution (zoom 1:1), you need to tell your application to export in 873×480 (for PAL that would be 1049×576). If you instead you export in NTSC’s standard resolution of 720×480 you will end up with a vertically stretched video, where everyone’s heads will look like eggs. If your application is “clever” it will add black bars on the top and bottom of your video (called “letterboxing”) and so you will avoid the stretching problem. But thing is, most applications are not very intelligent to do that, plus, by exporting to 720×480 you don’t export to the full extend of the real PC resolution (873×480) and so a resizing will take place by the encoder.

Resizing a video is bad news for quality, especially if the resolution you chose does not divide exactly over the original number. For example, an encoder will generate a better quality when resizing a video that’s 256×128 to 128×64, instead when resizing to 134×63, because 256/2×128/2=128×64. The math is just easier for the encoder. Even numbers (especially when these divide exactly by 16), mean better quality.

Here is a guide on what exact resolutions you need to export your DV/HDV footage to for the web/PC (instead for the TV), at aspect ratio 1.0000:
NTSC DV: 655×480 (or 654×480)
NTSC widescreen DV: 872×480. If you are using Vegas Movie Studio which is not able to export to anything bigger than 800×600, then the maximum resolution of your choice should be 800×440.
PAL DV: 786×576
PAL widescreen DV: 1048×576 (or for the half size 524×288 if you export for youtube). If you are using Vegas Movie Studio which is not able to export to anything bigger than 800×600, then the maximum resolution of your choice should be 800×440.
HDV: 1920×1080 (1080p), 1280×720 (720p), 960×540 (540p) or 848×480 (480p)

Of course, make sure that you also de-interlace your footage (when you export for the web/PC instead of DVDs). If you are using Vegas, here are some de-interlacing tips.

Finally, three more tips that users should be aware of:

1. If you shot in HDV or AVCHD at 1440×1080 with aspect ratio of 1.3333 (which generates a playback surface of 1920×1080), and then you want to export in 720p, you must change the aspect ratio in the exporting dialog of Sony Vegas from 1.3333 to 1.0000. You see, 1280×720 has an aspect ratio of 1.0000, just like 1920×1080 does. In other words, 720p and 1080p are not “anamorphic” standards, but 1:1 16:9 resolutions with aspect ratio of 1.0000. Thank God, the HD world is moving away from anamorphic resolutions and all the complexities they bring, and I am trying to explain here.

2. Do not export on delivery formats in NTSC or PAL resolutions for widescreen video by telling the encoder that the aspect ratio is anything different than 1.0000. Always export in resolutions that have aspect ratios of 1.0000 (after you calculate that resolution). You see, most media player applications and devices have no freaking clue how to deal with aspect ratios. So it’s better to feed them the right resolution that has aspect ratio of 1.0000 (e.g. the suggested resolutions above), rather than playing Russian roulette with the intelligence of developers who put together a media player on their free time during weekends and didn’t implement the aspect ratio features for all codecs. Except WMP, most other media players are hit and miss regarding aspect ratios, as they mostly expect 1.0000 aspect ratios. Worst of all in recognizing aspect ratios out of the box is MPlayer — avoid it like the plague.

3. On Sony Vegas, always have the “Simulate Device Aspect Ratio” option checked when you right click on the “preview window”.

Here’s another tip: calculating the size you need to use in order to convert an HDV footage (1920×1080 with aspect ratio being 1.0000) to a PAL DVD one (720×576), without stretching out the picture out of its correct aspect ratio. There are two ways to do this, one is by creating a 4:3 PAL DVD and one is by creating a 16:9 PAL DVD.

The formula for the 4:3 PAL DVD is this: 720*1080/1920=405. However, because PAL 4:3 DVD’s aspect ratio is 1.0926, you also need to do 405*1.0926=442, or it will look squashed on TV. So basically you need to export at a resolution of 720×442 in order to satisfy both the original 1.0000 pixel aspect ratio and the PAL aspect ratio. However, the PAL standard requires the DVD resolution to be 720×576, not 720×442. To go around the problem, you add black bars on the top and bottom of the video (letterbox) in order to fill out the rest 576-442=134 pixels (67 pixels above and 67 pixels below the actual widescreen video). If your application can’t letterbox, then you are using shitty software (sorry for the language, but I have an inherent dislike against encoder front-ends that don’t support automatic letterboxing).

Now, if you want to create a PAL widescreen DVD instead of a 4:3 DVD, you resize your HDV footage at 720×576 and you tell your encoder that the aspect ratio of PAL widescreen is 1.4568 (so this way the DVD player will know how to stretch the 720×576 4:3 image to look 16:9 on TV). Similar calculations go for NTSC DVDs too (you just change the aspect ratio number to 1.2121 and the 576 number of lines becomes 480 — the rest of the algorithm is the same).

Leave a comment or email me if all this still does not make sense to you.

I hate software, part 5

I just tried a PAL interlaced mpeg file (Ivan, it’s yours 😉 ).

I load it with Totem under Linux. It has interlacing jaggies when I play it. I select “View” and “Deinterlace”. Nothing happens. The jaggies are still there. I had to restart a number of times to get a de-interlaced result and if i change the window size or go full screen it interlaces again immediately. What a piece of shit.

I load the same file with VLC. De-interlacing is by default disabled and it has a number of algorithms, but no “interpolation” option. Only the “X” option is kinda usable, but it doesn’t stick for each video playback, and even if you tell it so on its preferences to use that method, it just doesn’t use it when you restart the app or you re-playback the video.

As for Mplayer, it doesn’t even have a GUI de-interlace option (I didn’t bother with its CLI which requires the pp=li flag) so there are always jaggies. More over, the aspect ratio is out of whack (known problem of MPlayer).

Software sucks. You just can’t count on it. Ever. Especially under Linux it seems.