Next Previous Contents

## 6.1How do I tell what frame rate to use?

Play the DVD using `mplayer -dvd N` where `N` is the title number. Pay attention to the status line, which will look something like this:

``` A: 391.8 V: 391.8 A-V: -0.002 ct: -0.104 200/197 21% 9% 25.0% 6 0 0% ```
The first two numbers tell you the time elapsed in the DVD. The two numbers in the middle separated by a slash tell you the number of frames played (they may be slightly different, because the first number includes NTSC synchronization compensation and the second number does not). Pause the movie, note the frame number, play the movie for ten more seconds, note the new frame number, and see whether the two differ by 240 frames or 300 frames. In the first case, your frame rate is 23.976; in the second case, 29.97. If you need more time, play the movie for twenty or thirty seconds and multiply accordingly.

It is important that you perform this experiment on the actual movie content itself and not the introductory splash screen that may be present on the DVD, since the splash screens very often use a different frame rate from the movie itself.

## 6.2What is inverse pulldown?

To understand inverse pulldown, you first need to understand pulldown.

Regular television video is interlaced, meaning that the odd numbered scanlines are displayed first, followed by the even numbered scanlines, then the odd ones again, then the even ones again, etc. Each individual line is displayed 30 times a second, but because of the interlacing, the television image as a whole is refreshed 60 times a second, with only half of the total lines being refreshed each time.

For regular television video, there is no way to recover perfect video frames, because no matter where you are in the video the odd numbered lines are always offset 1/60th of a second from the even numbered lines. There is a technique called deinterlacing which can approximately reconstruct original video frames based on the limited information available in the interlaced video, but deinterlacing is only an approximation and using it will result in some loss of quality.

However, most theatrical movies and anime shows are not filmed using television cameras. Instead they are filmed with film cameras (or, in the case of anime, drawn by hand) at a non-interlaced frame rate of 24 frames per second. In order to display these on TV screens, the 24 frames per second is deliberately interlaced to 30 frames per second using a process called pulldown, also known as telecine, which I will not explain because it is much better explained here or here.

What makes all this important is that, unlike regular television interlacing, the pulldown process can usually be perfectly reversed provided that you know it is there and you have a filter specifically designed to reverse it (that is, NOT a deinterlace filter--most deinterlace filters are not specifically designed to handle telecine). The reversal process is called inverse telecine or inverse pulldown.

Here are some frame grabs illustrating the above concepts (click for full frames):

## 6.3How do I tell if inverse pulldown is working?

Follow the directions in the video encoding section, but change the line `32detect=force_mode=3` to `32detect=force_mode=3:verbose` instead, leaving everything else the same. You will get a bunch of output on the screen that looks something like:

``` (0) frame : (1) = 243 | (2) = 245 | (3) = 1 | interlaced = no (0) frame : (1) = 199 | (2) = 240 | (3) = 1 | interlaced = no (0) frame : (1) = 215 | (2) = 230 | (3) = 1 | interlaced = no (0) frame : (1) = 235 | (2) = 229 | (3) = 1 | interlaced = no (0) frame : (1) = 220 | (2) = 244 | (3) = 1 | interlaced = no (0) frame : (1) = 243 | (2) = 249 | (3) = 1 | interlaced = no (0) frame : (1) = 230 | (2) = 256 | (3) = 1 | interlaced = no (0) frame : (1) = 206 | (2) = 218 | (3) = 1 | interlaced = no (0) frame : (1) = 213 | (2) = 200 | (3) = 1 | interlaced = no (0) frame : (1) = 223 | (2) = 180 | (3) = 1 | interlaced = no (0) frame : (1) = 188 | (2) = 192 | (3) = 1 | interlaced = no (0) frame : (1) = 210 | (2) = 219 | (3) = 1 | interlaced = no (0) frame : (1) = 238 | (2) = 218 | (3) = 1 | interlaced = no (0) frame : (1) = 211 | (2) = 202 | (3) = 1 | interlaced = no (0) frame : (1) = 211 | (2) = 199 | (3) = 1 | interlaced = no (0) frame : (1) = 223 | (2) = 224 | (3) = 1 | interlaced = no (0) frame : (1) = 178 | (2) = 241 | (3) = 1 | interlaced = no ```
If every row has `interlaced = no` in the right hand column, then you have succeeded in reversing the pulldown and removing the interlacing.

For comparison, here is an example of an unsuccessful attempt at inverse pulldown:

``` (0) frame : (1) = 55619 | (2) = 56592 | (3) = 324 | interlaced = yes (0) frame : (1) = 27924 | (2) = 28296 | (3) = 162 | interlaced = yes (0) frame : (1) = 26425 | (2) = 26147 | (3) = 152 | interlaced = yes (0) frame : (1) = 30923 | (2) = 31739 | (3) = 181 | interlaced = yes (0) frame : (1) = 21860 | (2) = 22136 | (3) = 127 | interlaced = yes (0) frame : (1) = 22056 | (2) = 22412 | (3) = 128 | interlaced = yes (0) frame : (1) = 16845 | (2) = 16770 | (3) = 97 | interlaced = yes (0) frame : (1) = 13148 | (2) = 12792 | (3) = 75 | interlaced = yes (0) frame : (1) = 13294 | (2) = 12528 | (3) = 74 | interlaced = yes (0) frame : (1) = 12787 | (2) = 12408 | (3) = 72 | interlaced = yes (0) frame : (1) = 12216 | (2) = 11771 | (3) = 69 | interlaced = yes (0) frame : (1) = 15243 | (2) = 15207 | (3) = 88 | interlaced = yes (0) frame : (1) = 18621 | (2) = 18998 | (3) = 108 | interlaced = yes (0) frame : (1) = 17195 | (2) = 17149 | (3) = 99 | interlaced = yes (0) frame : (1) = 16599 | (2) = 16748 | (3) = 96 | interlaced = yes (0) frame : (1) = 13009 | (2) = 12705 | (3) = 74 | interlaced = yes (0) frame : (1) = 10831 | (2) = 11430 | (3) = 64 | interlaced = yes ```

## 6.4Building dvdauthor RPMs

Download the latest `tar.gz` release from the distribution site (`dvdauthor-0.5.3.tar.gz` as of this writing). Put the file somewhere, and (as root) run the command

``` rpmbuild -ta dvdauthor-0.5.3.tar.gz ```
Make sure you have all the software development packages from the Red Hat CDs installed on your system before you try this. With luck, the compilation will produce a `/usr/src/redhat/RPMS/i386/dvdauthor-0.5.3-1.*.i386.rpm` file which you can then install.

## 6.5How do I make a timecoded video?

Create a PPML script containing the following four lines:

``` *counter frame_counter 1 *counter font_dir=/usr/share/mplayer/iso-8859-1/arial-28 2 *counter xpos=20 ypos=20 3 *counter sat=80.0 contr=70 ```
Subtitle your video using this script, and it will place a frame counter in the upper left hand corner of the video.

## 6.6What are some other ways to subtitle in Linux?

You can use the `mencoder` program included with mplayer to subtitle using the mplayer engine. Most of this material is covered pretty thoroughly in the previous version of this guide. The subtitles produced by `mencoder` look better on a computer screen than `transcode`, but worse on a TV screen. On the other hand, `mencoder` is for now the only program that supports subtitles in asian language character sets.

The xste program combined with submux-dvd allows you to generate soft (switchable) DVD subtitles that can be turned on or off by the DVD player. If anyone who speaks English figures out how to get this combination working, let me know.

The subtitler-yuv program is a standalone alternative to the subtitler plugin in transcode. It uses the same PPML script format, but instead of being a transcode filter it functions as a standalone program taking input video on STDIN and writing subtitled video on STDOUT. This strategy has the major advantage that the same video can be chained through multiple instantiations of `subtitler-yuv`, to imprint multiple subtitle streams onto a single video.

Next Previous Contents