Reports of the demise of this Web site are greatly exaggerated! We at sheldonbrown.com thank Harris Cyclery for its support over the years. Harris Cyclery has closed, but we keep going. Keep visiting the site for new and updated articles, and news about possible new affilations.


Deinterlacing in VirtualDub
find us on FB
John Allen portrait
by John Allen
Spoke Divider

What is interlacing?

Video recorded at the old NTSC and PAL broadcast standards, as well as 1080-line broadcast digital video as of 2019, is interlaced -- that is, a complete video image is produced by two consecutive scans (fields). Each video frame is displayed in two passes, called "fields", one after the other. The first field displays the odd-numbered scan lines of video, the second one, the even-numbered lines. A detailed explanation of interlacing may be found on Wikipedia. Why interlace? Interlacing is a simple form of data reduction which takes advantage of limitations of human eyesight

The image below is one frame from NTSC 640 x 480 interlaced video of a bicycle ride. Note the jaggy, doubled image in the foreground where the view is expanding as the bicycle moves forward, and the jaggy image of a tree trunks in the background due to panning.

Deinterlaced video image

Here is the same image deinterlaced. The jags are gone.

deinterlaced video image

The complete interlaced image is displayed only 25 or 30 times per second, reducing the bandwidth necessary to transmit the signal -- but the doubled field rate, 50 or 60 per second, is high enough to eliminate visible flicker. Interlacing does produce some visible artifacts, particularly "combing" or "jaggies" when there is rapid motion, a "venetian-blind" effect when motion upward or downward in the image harmonizes with the field rate, and "interlacing twitter" when an image contains sharp, computer-generated horizontal edges.

Today's digital monitors avoid the venetian-blind effect, but worsen the jaggies, because these monitors display the two interlaced fields of a video frame at the same time. Deinterlacing, if done well, solves this problem. Deinterlacing also is needed to make proper use of additional digital processing, in particular image stabilization and frame-rate conversion.

Remarkably smooth motion with a 50 or 60 FPS frame rate is a benefit of interlaced video, and can be retained when deinterlacing. Old-school filmmakers call this the "soap opera effect" because it reminds them of the smooth motion of television programs which were broadcast live or recorded on videotape. The old-schoolers prefer the jerky motion of 24 FPS film -- some even prefer black and white!

I say "pshaw!" I go for the highest possible image quality in my videos. Smooth motion at 50 or 60 FPS is much more realistic and does a lot to spiff up old videos, despite the low optical resolution. The clearer my informational videos can be, the better.

The MSU deinterlacer

For years, I have been using the free VirtualDub video processor with its internal deinterlacing filter. I have not been very happy with that filter. It is rather unsophisticated and leaves in a lot of jaggy edges.

I have recently discovered a much better deinterlacer, from the video group at Moscow State University in Russia, available here.The MSU deinterlacer interpolates nicely on diagonal edges, avoiding a "stair step" appearance. Apparently, this deinterlacer senses where the video has sharper differences between lines than the camera could generate, and places the step for the intermediate edge between those of two lines of the current field.

I do see a bit of distortion at horizontal and near-horizontal edges with small detail. The MSU also faile with near-horizontal lines against a blank background, such as electric wires against the sky. The MSU deinterlacer evidently does not morph images to compare and average multiple frames. A deinterlacer which does this is going to be much slower, and expensive. The MSU deinterlacer is already slow enough as it is, taking about twice as much time as the video takes to play on my Intel i7 3.4 Ghz computer

The MSU deinterlacer is available only for 32-bit VirtualDub. My experience is that VirtualDub filters run about 30% faster with the 64-bit version.

Is the input video suitable?

Only video which is truly interlaced can be deinterlaced. This will show in in VirtualDub's display of the input video in parts of the video image where there is motion, as seen in the first image above. Other kinds require different processing, and so, before running the deinterlacer, you need to determine whether the source video is interlaced.

Analog videotapes as well as standard NTSC or PAL digital tapes are interlaced, but the video from them may become poorly deinterlaced inadvertently. I find this to occur in Pinnacle Studio Ultimate 20, which I use for video editing. Whether it happens depends on the output video settings, and that isn't always made clear. In particular, if you save an AVI file in MPEG-4 "best quality NTSC", it will be crudely deinterlaced, and the resolution will be reduced from 720 x 480 to 640 x 480. This may be a limitation of MPEG 4, or a decision made because the video is intended for siplay on a computer, I don't know. But if you save as AVI at the original resolution, the video will remain interlaced and the resolution will remain 720 x 480. You can then do a better job of deinterlacing it.

You need to run tests to determine whether a video is interlaced or deinterlaced, and how to proceed. To work with:

Spoke Divider

Spoke Divider

Using the Deinterlacer

Using the MSU deinterlacer is simple. Open the "Filters" dialog box in VirtualDub, click on "Add" and select the filter It opens a small dialog box with a button to select whether the top or bottom field comes first, and another to double the frame rate. As already stated, test this setting on a short segment of video. Double the frame rate to produce 50P or 60P video for smooth motion. Leave the dialog box and select a video compressor. (If you do not, VirtualDub will produce a huge, uncompressed file.) I use the free XVid Divx h.264 compressor. Then go to the file menu, click on "Save as AVI", choose a file folder and filename and go have a cup of coffee, or go have dinner, depending on how long your clip is.

For my helmet-cam videos, I follow up the MSU deinterlacer with Deshaker. Deshaker cannot properly read the output of the MSU deinterlacer in a single pass, so you must save a file when deinterlacing, then run Deshaker on that file. Deshaker works really well with a 50 or 60 frame rate. You will want to double the motion settings compared with those for 25 or 30 FPS video. I sue settings of 300 for 60 FPS video: this smooths the motion enough so the eyes can track it. and it looks natural.

I had to copy one file using Pinnacle Studio before I could run the deinterlacer on it. It then displayed on my computer monitor with doubled images for objects in motion. "Display information" for the clip indicated that it was interlaced top field first. It exported correctly though at 60 frames per second.

Here is a video which I processed with the MSU deinterlacer and Deshaker. Pretty darn good, assuming that your monitor supports a refresh rate of 60 per second or a multiple!

Shining Sea Path at Ter Heun Road from John Allen on Vimeo.

shining-sea-terheun from John Allen on Vimeo.

Spoke Divider

Spoke Divider

Using 50P and 60P video

OK, now you have a 50P or 60P video.

Editing a 50P or 60P video requires that the editing software support that format. I use Pinnacle Studio Ultimate version 20. Its timeline supports 50P and 60P.

One Pinnacle settings option is to determine timeline setting from the first clip added in a new video. I don't recall 60P as being available before I applied this setting, but once I did, the option appears to have "stuck" -- it is still available when I close and reopen PSU 20 and insert a first clip that is not at 60P. I can also change it when I have already added clips. The red circle in the image below surrounds the icon to bring up the timeline settings, and the arrow points to the 50P and 60P options in the dialog box which opens when you click. Choose the same frame rate as that of your video clips.

Timeline settings in Pinnacle Studio Ultimate 20

The display during 50P or 60P editing will be jaggy because it is showing only alternate lines, but the image will be smooth in export.

Here is a typical dialog box for export from Pinnacle Studio Ultimate 20. This one is for Windows Media Video.

Exporting to a 60P WMA file

Some export formats offer 59.94, which is the same as 60 for all practical purposes. 59.94 or 60 FPS options appear sometimes to depend on the timeline setting: if it is also 1280 x 720, 60P, the image is pillarboxed in the 16:9 formats. Sometimes the image is stretched to fill the frame; also the thumbnails in Windows File Explorer don't always appear in the same aspect ratio as the video. So, you may need to do a bit of experimentation. I did find these options:

To take proper advantage of 50P or 60P programming, the display must refresh the image at that frame rate or a multiple. A refresh rate which is higher than the frame rate but not a multiple will result in uneven motion or tearing of the image. Most computer monitors can run at a refresh rate of 60 per second; the settings application on the computer screen may allow this to be changed. 50 frames per second is less common, but 100 frames per second is common with gaming monitors. Flat-screen televisions may support 50P, 60P, or both.

Video services YouTube and vimeo both support 60P video (I'm not sure about 50P) but frames may be dropped, resulting in jerky motion, if the server or Internet connection can't keep up with the data rate. Dropped frames are more common, the higher the video resolution.

Spoke Divider

Spoke Divider

Links:

The Garmin VIRB 360 camera

The Sony AS100V helmet camera

the Mobius M800 action camera/dashcam

The Contour HD1080 helmet camera

The GoPro Helmet Hero HD helmet camera

The GoPro Session action camera

Synchronizing multi-camera shoots

Image stabilization for bicycle video

VirtualDub video processor

Image stabilization plugin for VirtualDub

Deinterlacing in VirtualDub

Saving to MP4 in VirtualDub

Using VirtualDub to improve video from VHS tape

Pinnacle and Avid editing software

Five Ways to Create a Picture in Picture in Pinnacle Studio Ultimate

Pinnacle overwrites voiceovers...

Techmoan Web site -- reviews of action cams

Spoke Divider

Spoke Divider

Articles by Sheldon Brown and Others


Reports of the demise of this Web site are greatly exaggerated! We at sheldonbrown.com thank Harris Cyclery for its support over the years. Harris Cyclery has closed, but we keep going. Keep visiting the site for new and updated articles, and news about possible new affilations.

Copyright © 2012 John S. Allen

Harris Cyclery Home Page

If you would like to make a link or bookmark to this page, the URL is:
https://www.sheldonbrown.com/video-editors.html

Last Updated: by John Allen