Deinterlace Help

From 911datasets
Jump to: navigation, search

Contents

[edit] Deinterlacing Video - Basic HOWTO

Many of the videos in the archive are provided in an interlaced form.

This basically means that each frame of the video actually contains two separate pictures.

When interlaced video is viewed, rapidly moving features can look very blurred with odd ghosting and dithering effects.

This is not a problem with the video. It simply means that your video player is not deinterlacing the video for you.


Example Interlaced Video Frame

Source Frame.png


The videos are provided in the same form as they were received within the FOIA release. The only process applied is conversion from the original compression format to H.264. As many of the original videos were in effectively raw formats, this has reduced the size of the archive from an unwieldy 942Gb to less than 100Gb, whilst being as transparent as possible.

Retaining the original interlace state of each video allows you the choice of how to handle the video data. Any additional processing before release would deny you this opportunity. If we had deinterlaced the video, you would not have the option of choosing how to, or whether to, deinterlace it yourself. This may imply a little more effort on your part to get each video into the form you require, but the more important factor is that the data is provided to you as transparently as possible.


A guide to interlaced video can be found here: http://www.100fps.com/

Please read the guide for a good introduction to interlaced/deinterlaced video.


This HOWTO is intended to help you treat video files for the best possible viewing quality, depending upon your purpose.

It's not intended to provide full in-depth explanation, but simply enable you to get the job done well.


The different types of purpose covered are:



[edit] Required Video Processing Tools

Although the principles involved apply to all video editing packages, details in this HOWTO are presented using VirtualDUB, as it is free, easy to use and does exactly what it says on the tin.


VirtualDUB and Required Filters


To keep things simple, VirtualDUB and required additional filters have been set up and packaged in the following zip file:

(insert archive)

Simply unzip it to your desired location. No installation is required.


If you are an existing VirtualDUB user, you will need the following filters. They should be unzipped into the Plugins32 folder to ensure they are loaded when VirtualDUB starts:


Deinterlace Area Based - http://www.infognition.com/cgi/getfilter?id=71

Deinterlace Smooth - http://www.infognition.com/cgi/getfilter?id=73

Canvas Size - http://www.infognition.com/cgi/getfilter?id=160

Full filter list - http://www.infognition.com/VirtualDubFilters/detailed.html

VirtualDUB - http://virtualdub.sourceforge.net/


H.264 Codec Installation


The original FOIA release video files have been compressed using the video codec H.264 (HD).


To view and create H.264 encoded files within VirtualDUB, you will need to download and install the following codec:

(insert archive)


The provided H.264 codec is not current, as the latest version is awkward to configure for use with VirtualDUB.


If you wish to use the latest version, it can be downloaded from:

http://sourceforge.net/projects/x264vfw/


Please be aware that you will have to change various codec settings to get it to work properly, which are beyond the scope of this quick HOWTO.


This may seem like a lot of messing around, especially if you can already double-click on the video files and view them, however the purpose is to allow you to, not only view, but to create H.264 format video files. Very few people already have the necessary files installed to encode video in this format.


[edit] Watching the video on your PC

All you'll really want to do, if the interlace effects are unwanted, is to deinterlace the video file.

If you have read the guide linked at the the top of this HOWTO, you will know that there are many ways to deinterlace.

We will simply show you how to apply a very good, freely available method, fit for the purpose - Area Based Deinterlacing.

Area Based deinterlacing retains the full height of each video frame, interpolates areas with interlace artefacts, and outputs video with the same framerate as the input video file.


Applying the Area Based Deinterlacing Filter



Sample Area Based Deinterlace Frame

AreaBased.png


If you now play the video, or scrub through it with the mouse-wheel, you should see the original video on the left, and the deinterlaced video on the right.


Remember to Save the Processed Video !


[edit] Uploading Video to YouTube

The procedure for preparing video for sites such as YouTube is the same as for viewing the video on your PC, but with the following additional considerations:

a) The most useful video format to upload to YouTube is H.264. They still recode your file, but a good H.264 quality file will remain so when viewed on YouTube. You can use an uncompressed RAW format for absolute maximum quality, but bear in mind your file size will be very large.

b) If you think people will want to download your video, it is best to ensure that your video is in one of the standard HD resolutions (1280*720 or 960*720). It is recommended that all uploads to YT are pre-processed to one of those resolutions. If the video is NOT in one of these formats, the video cannot be downloaded in H.264 format, but instead only a, frankly poor quality, mp4, flv or 3gp low resolution file, regardless of how good your original upload was.


Follow the steps above for viewing the video on your PC, then...


Rescale Video to 720p



Enlarge the Canvas



Remember to Save the Processed Video !


Tip - If you want users to be able to download your video in HD H.264 format, but don't want to rescale the video (so that you provide them with one-to-one pixel data, simply omit the resize step and retain the canvas enlargement step. Your video will have a large black border.


[edit] Analysing the video frame-by-frame

When analysing video at frame-level, maximum image quality is required, but in addition it can be important to ensure that each image you look at contains only one moment in time.


Two steps are suggested, and most users will need to apply both:



These methods separate each input video frame into two separate images, resulting in the output video having double the framerate.

For example, a video with an input framerate of 29.97 fps is transformed into a video with a framerate of 59.94 fps.


The first step (bob double) results in half height video. The second step uses the half height video data to construct a full height progressive frame. In purist terms, the half height data is most 'correct, but usage of video data in that form is quite specialised and beyond the scope of theis brief HOWTO.


Due to complexities with retaining audio synch when doubling framerate, and that few video players display 59.94 fps video without skipping frames, it is highly recommended that audio is removed from files which are processed for the purpose of frame-by-frame analysis, and this guide will specify removal of audio as a required step.


This can be achieved by simply selecting No Audio from the Audio' menu within VirtualDUB.


Raw deinterlacing - Bob Double


Your output video will currently be half height but you will have twice as many frames.


Sample Bob Double Frame - Top Field

BobDouble TopField.png


Sample Bob Double Frame - Bottom Field

BobDouble BottomField.png


It will also bob up and down on alternate frames. This is the correct behaviour. Full height frames will be restored by applying the subsequent steps.


Check the Field Order

If moving objects jump forwards and backwards when you scrub through the video (you will know what this means when you see it), you need to swap the field order.

As each video frame contains two images, each from a separate point in time, the order of these images is important.

There is no foolproof way of knowing which way round they are stored, so it is necessary to look for the problem manually, and if it's present simply swap the order of the images

To swap the field order...



Progressive Deinterlacing - Bob-Weave (Smooth Deinterlacing)


First, apply the 'bob doubler filter and check the field order as shown above, then...


Example Smooth Deinterlace Frame - Top Field

Smooth TopField.png


Example Smooth Deinterlace Frame - Bottom Field

Smooth BottomField.png


Check the Field Order AGAIN

If the video bobs up and down a little, or you see mice teeth interlace artefacts when you scrub through the video, you need to swap the field order in the deinterlace - smooth filter options...



[edit] Saving the Processed Video

We are not quite finished yet, as the settings to write out an updated video file must be configured...


Configure Output Video Format


Details to output video in H.264 format are provided here, but you can of course choose to use any format you wish.


Configure Output Audio Format


VirtualDUB has many audio options, however, to retain the highest quality you should not modify the audio in the file at all.


For viewing or uploading - Ensure that Direct Stream Copy is selected in the Audio menu.

For frame-by-frame analysis - Ensure that No Audio is selected in the Audio menu.


Save the Deinterlaced Video


You are now ready to save the deinterlaced video file.


[edit] Job Done.

(Guide creation in progress. Full text will be in-place by the time the torrent goes live.)

Back to Release 14 - NIST Cumulus Video Database

Personal tools
Namespaces
Variants
Actions
Navigation
Wiki HOWTO
Old Forum
Toolbox