Roger Maddy's Blog

VirtualDub3D

This freeware program for the PC, along with the mentioned filters, converts 3D MPEG and AVI videos or BMP images (crossed, parallel, over/under, interlaced, anaglyph) to other 3D formats, providing a full range of filtering options, like deinterlacing, resampling, hue adjustments, sharpening, etc. This page is only an introduction to show some basic examples of what can be done... with some additional experimention, almost anything is possible.

2 Simple Steps To Downloading VirtualDub and The 3D Filters:

1. Download the latest version of VirtualDub freeware from http://www.virtualdub.org/.


2. Download only the *filters that you need and unzip them into the "plugins" folder:
*For red-blue anaglyphs:
Interlaced RGB *For conversion to over/under (and back): A) ViewFields B) UnViewFields *For adjusting the saturation for anaglyph conversion: Hue/Saturation/Intensity For adjusting the brightness of the anaglyph's red lens image: Color Equalizer *And a couple of great filters (mainly for advanced editing and conversions) for general alignment purposes: A) Field Align B) Field Shift


Converting BMP's With VirtualDub:

Here's an AviSynth script that will open a left and right BMP pair and convert them into a parallel pair:

left= ImageSource("left.bmp")
right= ImageSource("right.bmp")
StackHorizontal(left, right)

For parallel pairs, if you open BMP's in VirtualDub, make sure they are numbered, like "filename1.bmp", or they won't open. You can then save the conversion to another BMP under "File" and "Save Image Sequence". This will save only that one image. To quickly open that image in another image software program, first copy the output frame to the clipboard under "Video" and "copy output frame to clipboard" or "Ctrl + 2" on your keyboard, then paste it into the new program. You can also save that one image to an AVI. This is good if you want to later add it to another AVI, under "Append AVI Segment". You can batch convert BMP's by putting all of them, numbered in sequence, into one folder, then opening the first one. You can then save them as an image sequence or AVI.


Important! To preview videos in an uncompressed state in VirtualDub (necessary for "as good as it gets" anaglyph or interlaced 3D viewing), go to "Options" and "Swap Input/Output Panes and click on the play button on the right (third button from the left at the bottom of the main VirtualDub window).

Important! If the video does not play smoothly, go to "Options" and "Drop frames when behind". If that doesn't work, go to "Video" and "Frame Rate" and under "Frame Rate Decimate", decimate the video until it plays smoothly. This will noticeably slow the frame rate, but it will play without stuttering.

Important! To align the images and/or crop off a border for anaglyph or interlaced viewing, use either the "Field Align" filter or the "Cropping" feature in the main Virtual Dub filters window (lower right side). There has to be a filter applied to use the cropping feature. (Use the "null transform" filter if you want to crop without using any other filter.)


VirtualDub3D Conversions:

(The following conversions are using a parallel video as the source. For instructions on combining two separate video streams, refer to the links at the bottom of the main PuppetKites.net page.)

Important! If you want to enlarge (upsample) the image, first add the "Resize" filter and change it to the new size you want. In the "Filter Mode" box, choose the "Bicubic" or "Lanczos3" resize method.

 

Red-Cyan, Shade-Corrected, Color Anaglyph - Progressive (Non-Interlaced) Wear "red-blue" glasses, with red over the left eye.

For best results, use this progressive (non- interlaced), red-cyan conversion method for uncompressed, on-the-fly viewing (preview), or for saving as uncompressed or lossless videos (warning - very large files). MPEG (or lossy of any kind) compression degrades this anaglyph conversion, and makes some of them almost unwatchable, depending on content. For lossy compression and making an MPEG 2 , SVCD or DVD, use only the "field sequential" anaglyph conversion method below this one to compress to MPEG 2 or disc.

1) Add the "Hue/Saturation/Intensity" filter and desaturate only the colors that are possibly overwhelming in the images by 50%. (You can also adjust the "Hue" and "Intensity", and if needed, you can add multiple applications of this filter.) You can come back to this filter later, after you view the final anaglyph conversion, and change the settings. Even though this filter is applied first, you sometimes won't know what needs to be desaturated until you look at the final anaglyph conversion.

2) Add the "Deinterlace" filter and "Fold Side-By-Side Fields Together".

3) Add the "Interlaced RGB" filter. Under "Even Lines", put a check in the RGB2Y box. (Checking the RGB2Y box converts the left image to grayscale. Don't ignore this step!)

4) Open a second application of the "Interlaced RGB" filter. Under "Even Lines" and "Clone", click on "R". Under "Odd Lines" and "Clone", click on "G" and "B".

5) Add the "Resize" filter and change it to the size you want. (half the height)

6) Now, look at the finished anaglyph through the glasses. The red side usually needs to be brightened a bit, perhaps 5% or so. Do that with the "Color Equalizer" filter by increasing the amplification of the red or decreasing the amplification of the green and blue (equally).


Red-Cyan, Shade-Corrected, Color Anaglyph - Field Sequential (also called "Interleaved" or "Interlaced")

1) Add the "Hue/Saturation/Intensity" filter and desaturate only the colors that are possibly overwhelming in the images by 50%. (You can also adjust the "Hue" and "Intensity", and if needed, you can add multiple applications of this filter.) You can come back to this filter later, after you view the final anaglyph conversion, and change the settings. Even though this filter is applied first, you sometimes won't know what needs to be desaturated until you look at the final anaglyph conversion.

2) Add the "Deinterlace" filter and "Fold Side-By-Side Fields Together".

3) Add the "Interlaced RGB" filter. Under "Even Lines", put a check in the RGB2Y box. (Checking the RGB2Y box converts the left image to grayscale. Don't ignore this step!)

4) Open a second application of the "Interlaced RGB" filter. Under "Even Lines" and "Cancel", click on "G" and "B". Under "Odd Lines" and "Cancel", click on "R".

5) Add the "Resize" filter and change it to the size you want (half the height). Be sure to put a check in the "Interlaced" box in the resize filter.

6) Now, look at the finished anaglyph through the glasses. The red side usually needs to be brightened a bit, perhaps 5% or so. Do that with the "Color Equalizer" filter by increasing the amplification of the red or decreasing the amplification of the green and blue (equally). MPEG encoding tends to darken the colors. Experiment with brightening carefully when you make an MPEG 2!


Shade-Corrected, Parallel Pairs For Anaglyph

This method makes either a parallel pair with the left image converted to grayscale and the right one as a full color image, or a parallel pair with the left image converted to red and the right one as a cyan image... but with all the shade corrections, hue adjustments, etc, needed for a *perfect* anaglyph. This conversion has to be saved (you can use lossy compression, like MPEG 1 or DivX for videos, or JPEG for stills) and then opened in a 3D software viewer as a side-by-side (parallel) image and viewed as a "Color Anaglyph". Do not use a "half color" option, as that conversion has already been done. High resolution images are possible... basically as high as your computer can play smoothly. Of course upsampling (enlarging) is not recommended, as that degrades image quality. Basically, you use the same exact steps as in the field sequential anaglyph conversion, but you end the process by converting the anaglyph back to a parallel pair before rendering, and you delete the step that converts the image to anaglyph.

The first 6 steps are basically identical to the "Red-Cyan, Shade-Corrected, Color Anaglyph - Field Sequential" method.

1) Add the "Hue/Saturation/Intensity" filter and desaturate only the colors that are possibly overwhelming in the images by 50%. (You can also adjust the "Hue" and "Intensity", and if needed, you can add multiple applications of this filter.) You can come back to this filter later, after you view the final anaglyph conversion, and change the settings. Even though this filter is applied first, you sometimes won't know what needs to be desaturated until you look at the final anaglyph conversion.

2) Add the "Deinterlace" filter and "Fold Side-By-Side Fields Together".

3) Add the "Interlaced RGB" filter. Under "Even Lines", put a check in the RGB2Y box. (Checking the RGB2Y box converts the left image to grayscale. Don't ignore this step!)

4) Open a second application of the "Interlaced RGB" filter. Under "Even Lines" and "Cancel", click on "G" and "B". Under "Odd Lines" and "Cancel", click on "R".

5) Add the "Resize" filter and change it to the size you want (half the height). Be sure to put a check in the "Interlaced" box in the resize filter.

6) Now, look at the finished anaglyph through the glasses. The red side usually needs to be brightened a bit, perhaps 5% or so. Do that with the "Color Equalizer" filter by increasing the amplification of the red or decreasing the amplification of the green and blue (equally).

7) If you are not wanting to use this conversion for page-flipping or dual display output for dual projectors without anaglyph filters, you can now go back and delete the "Interlaced RGB" filter in step #4. If you want to use it for page-flipping or dual display output for dual projectors without anaglyph filters, leave it as it is, and you will end up with a red left and right cyan pair. Important! Leave the filter in step #3 alone, either way! Do not delete that one!

8) Go back to the Resize filter in step # 5, and change the size back to 100% (both width and height).

9) Add the "Deinterlace" filter and "Unfold Fields Side-By-Side".


Interleaved (or "field sequential 3D") for Shutterglasses

1) Add the "Deinterlace" filter and "Fold Side-By-Side Fields Together".

2) Add the "Resize" filter change it to the size you want. Put a check in the "Interlaced" box.

If you need to swap fields, you can simply drag the video up or down on your monitor, or add the "Field Swap" filter.


Crossed

1) Add the "Deinterlace" filter and "Fold Side-By-Side Fields Together".

2) Add the "Field Swap" filter.

3) Add the "Deinterlace" filter and "Unfold Fields Side-By-Side".


Vertically Interleaved for Autostereoscopic Displays

1) Add the "Rotate" filter and rotate "Left by 90°".

2) Add the "Resize" filter and change it to the size you want (half the height).

3) Add the "UnView Fields" filter.

4) Add the "Rotate" filter and rotate "Right by 90°".