Monday, July 6, 2015

Converting DVDs - some pointers

(Updated May 11, 2016)

I haven't seen a single DVD ripping program in the world that can convert them correctly automatically.
There are some points about the way DVDs are encoded onto the disc recording space that need to be known.
The standard recording space is 720w x 480h pixels in the NTSC video system (North America). For PAL it's 720x576p. I'm dealing with NTSC. The first thing to realize is that it is NEVER coded in the correct shape on the disc. There is a formula, and the player knows how to interpret it and display in exactly the right way. You have never seen a DVD player make a mistake that way.
However when it comes to computers, there are plenty of mistakes. The world of ripped DVDs on the web is a disaster area.
Firstly, the individuals who write ripping programs don't know everything they need to know. Experts from the commercial DVD world would be needed to advise. I don't know all the formulas myself.

Aspect ratio means "SHAPE", the shape of the picture. AR 1.50 means width is 1.5 times the height. That happens to be the AR of 35mm film. That can also be written as 3:2.
Widescreen TVs are 16:9, or AR 1.77. Old square TVs are 4:3 or 1.33. Old non-wide movies were AR 1.37. Cinemascope was AR 2.35. The formally correct way to write that is 2.35:1. The most common widescreen movies are AR 1.85.
There are many variations in shape in the film and video world.

When coding onto a DVD, it either expands the width of narrow ARs, or squashes the width of wide movies. It also typically leaves black margins on either side which are not part of the picture.
So you need to know those margins in each DVD so you can crop them out. Then you need to know the correct AR for converting the remaining image area. The AR is coded into the DVD specs and rippers can find that easily. The locations of side margins is something NOBODY has mastered. So you end up needing a conversion program that lets you see the DVD image first, then manually tell it how to crop.
This is what rippers need to incorporate in programs. There is a format for giving the image area that looks like this example, for a 720x480 DVD:  8:0:704:480.  I need some expert to tell us where this is found in a DVD.
It means the left margin is 8p, width of image is 704p, leaving right margin of 8p. It is common to have 16p excess space on DVDs. The exact figures can vary a lot. The 2nd and 4th numbers mean height starts right at the top and goes all the way 480p.

Here are images of one movie recorded by someone from TV and made into a DVD. As displayed in VirtualDub the exact way it's coded onto the DVD, 720x480p NTSC. At about 1h50m the framing changes for the rest of the film, from one frame to the next.
This kind of change only happens occasionally.

Programs that let you view the image before conversion include VirtualDub and Fair Use Wizard. VD needs the mpeg2 plugin. For DVDs that are not protected, you open the DVD VIDEO folder and note the VOB sections that contain your target video. In VD use the open command with extended options, load the first VOB plus the others in the set. It will create one continuous video file. This will give you avi output with correct audio sync.

I'm calling on writers of ripping programs to learn the cropping specs and incorporate them. Then have an automatic feature where the user gives you a general instruction for size of output, and you rip it using the right cropping and AR. The user could tell you one of the dimensions like width.
It is eminently unreasonable to ask every user to give you the exact dimensions WxH. It's also unreasonable to ask ordinary people to know things like target bitrates.
I also say don't get messed up with requiring dimensions to be multiples of 16 or whatever, so that you produce the wrong shape like an illiterate SLOB. Or you could automatically pad borders with a margin if you insist.

What, you don't think this belongs in a Music Journal? Well just rip da soundtrack and shaddup.