3D Vision Blog

A normal user's look into the world of 3D Stereo Technologies

3D Vision Blog header image 2

Converting 2D Videos to 3D using VirtualDub and the AviSynth Script

January 15th, 2010 · 86 Comments · 2D to 3D Conversion

avatar-teaser-s3d-3d-vision


The 2D to 3D Realtime Video Conversion Script for Avisynth v0.3 was designed to be used for realtime conversion, but it can as well be used to get a permanent video converted from 2D to 3D. Sometimes you might just want to have a separate video already converted or your PC might for example not being able to handle 1080p content in real time. An example for converted video is the 1080p Avatar Trailer that you can download from the links below, the video file was just converted with the script so you can see what it is capable of. Just don’t forget that here I’m talking about automated 2D to 3D conversion which can usually provide good results, but they are not as good as what you’ll get from a video shot in Stereoscopic 3D mode. In order to convert videos to 3D with a file output, besides the AivSynth script you’ll also need to download the free video editor VirtualDub along with some codecs that are needed to handle the video and audio output. A good example for that would be Xvid for video and LAME MP3 for audio, but others might as well do… just have in mind that I’m talking about encoding here and not just about being able to decode these formats.


virtuadub-xvid-video-compression


You need to open VirtualDub and then Open as a video file the 2D to 3D AVS script instead of directly opening the video file you’ll be converting, don’t worry, the AviSynt script will do what is needed and will just pass video that VirtualDub can interpret. Then Open the Video menu, make sure that Full Processing mode is selected (on by default) and Open up the Compression menu, where you’ll see a list of compatible codecs installed on your PC. You can choose Xvid MPEG4 Codec and Configure it to use Single pass quality based encoding with a Quantizer of 4 in order to have a good ratio between compression size and image quality.


virtuadub-mp3-audio-compression


Recompressing the audio is optional, but you’d need to do it as otherwise the file has PCM audio that just makes the size of the file too big. In this case you need to open the Audio menu, select the Full Processing Mode (here it is not on by default) and choose the Compression option. Again you’ll see a list of installed and supported audio codecs, here MP3 is just fine for Stereo output and you can choose 128Kbps for good enough quality and small file size.

What you need to do now is just save the output file as Avi and the recompression of the video will begin, the time it can take varies depending on a lot of factors for example if you are using a single or multi-core CPU, what it the size and length of the video etc. Here you just need to wait a bit for the processing to finish and after that you’ll be ready to play your converted video file directly in the stereoscopic player without the need to go through the AviSynth script for real-time conversion. So now back to the Full HD 1080p teaser as an example that I’ve converted using my conversion script and VirtualDub, the file is about 170MB…

Download the Avatar 1080p teaser autoconverted in stereo 3D formatmirror 1

Tags: ·······


86 responses so far ↓

  • 51 Prasenjit // Sep 22, 2010 at 01:03

    I have a 3-d glass that is not red cyan but normal 3d glass usually used in movie hall.
    I can’t view any 3d using u’r code….I have LCD monitor.Pls help.
    I have converted one movie using u’r script.
    pls help.Does the code also works for that glass?

  • 52 MZES // Sep 22, 2010 at 09:45

    how to comment and uncomment the script

  • 53 Greg // Oct 9, 2010 at 17:22

    Thanks for this (someone sent me the link to here). I’ve been wanting to try some movie conversions, but based on this particular post and the other one about the conversion script…and forgetting about stereoscopic player….how can I do this to create a conversion as an anaglyph video file to view either on my PC or my DVD player which plays AVI…or even to burn to a blank DVD? Anything like this I’ve run across always talks about the stereoscopic player, but not about simply making an anaglyph file or DVD.

    Thanks.

  • 54 Albert // Oct 17, 2010 at 14:35

    Hi, i tryed to download HD video on youtube with fvd suite. When i apply the script and open the file on virtual dub i see this message:

    Crop: Destination Width is 0 or less
    Line 51

    But work with file created by fraps.

  • 55 Bloody // Oct 17, 2010 at 16:03

    Apparently the script has some issues getting the right frame size of the video, you can try setting it manually in the script as a workaround for the problematic file…

  • 56 AKram // Oct 19, 2010 at 22:51

    Pls help me. I did as u said. but i am getting side by side video in my tridef media player. i can feel the depth in both videos. but side by side.i think i prefer row interleaved. i am having 3d laptop 120 hz display.

  • 57 abhishek tyagi // Nov 14, 2010 at 18:43

    i tried it, my video plays blank after the conversion, audio seems to be fine though

  • 58 abhishek tyagi // Nov 14, 2010 at 19:05

    i found out what is wrong, i m trying to convert .mkv (blu ray format) but it only converts .avi if I am not wrong. please confirm.

  • 59 abhishek tyagi // Nov 15, 2010 at 05:06

    @ Martin Haverland : i downloaded the Avidemux 2.5, please tell me the procedure to extract the audio and then attach it with the video of the output file.

  • 60 kakarot // Dec 1, 2010 at 19:57

    when i opened my video it showed like sid by side

  • 61 kakarot // Dec 2, 2010 at 17:35

    It is Work now thanx

  • 62 Red // Jan 13, 2011 at 07:48

    Hello and thank you for this guide… used a sample from TRON LEGACY to test on. It works alright except that it changed the aspect ratio for some reason. And as I am a noob at technical stuff I cannot tell you what codec and datastream and all those things are. The sample looks normal but the encoded 3d version is like the half of it ( from top to bottom)… any ideas?

    Regards,

    Red

  • 63 Red // Jan 13, 2011 at 07:50

    The screen I watched it on is a 50″ Panasonic Viera ( if this may help for aspect ratio things)

  • 64 Red // Jan 13, 2011 at 18:54

    Also the file ends with a size over 160 GB ( Starting of on 800mb)

  • 65 Bloody // Jan 13, 2011 at 19:09

    Check what codec are you using for compressing the video, apparently you are using uncompressed AVI or a codec with a very little compression. This might also be the reason for getting wrong aspect ration, since the codec you are using might not be able to accept such high width/height you need for Side by Side stereo 3D. Get Xvid and try it out with it as shown in the example above…

  • 66 Red // Jan 14, 2011 at 06:42

    I actually used te Xvid codec. On another try with another film the end result was…. half of the picture on the left side was ok and then strecht out over the rest of the screen… :(

  • 67 Bloody // Jan 14, 2011 at 13:21

    Then there is probably something messed up with the software on your system, it is not possible with Xvid compression to get 160 gigs video output from an 800MB source video. Did you try playing the script through Media Player Classic for example to see if you get proper image there?

  • 68 Red // Jan 15, 2011 at 06:13

    File size fix. Reinstalled the codecs. Just aspect ratio and sound problems now. The sound seems to be off after conversion.

  • 69 Bloody // Jan 15, 2011 at 13:19

    If the source video uses VBR audio then VirtualDub may have issues with it and the resulting sound may be a bit out of sync because of that. You can try with Media Coder as an alternative also to see if the aspect ratio issue will be fixed.

  • 70 Red // Jan 17, 2011 at 07:07

    Different Question: Would it be possible to record whatever a Stereoscopic Player plays on pc and convert that file so I can Burn it?

  • 71 Red // Jan 17, 2011 at 07:26

    Nvm… The player does not create the SBS effect…

  • 72 Red // Jan 17, 2011 at 08:15

    Hello again.. MediaCoder definitly solves the audio problem after alot of experimenting… The aspect ratio is following: (for example)

    Original File: 700*300
    SBS File: 1400*300
    Setting my tele to SBS 3D: It will stretch the 700 to maintain the 1400… which is sad :(… Any idea how to fix this issue?

    The television is a PANASONIC VIERA TX-P50VT20B 50″ Full HD 3D Plasma TV….

  • 73 Red // Jan 17, 2011 at 08:58

    Ok.. tried playing around with the script. Tried the Up/down and interlaced modes… definitly did not work. Is there somewhere in the script where i can change the resizing thing?

  • 74 Bloody // Jan 17, 2011 at 11:09

    For Side by Side it is normal that the script will double the width, because you have the left and right frames next to each other. With Above/Below mode the height will be doubled. When switching the TV to Side by Side mode it should split the video frame in half and display it properly at least in theory.

    You can try to upscale the output video to match Full HD resolution as closely as possible, but depending on the input video’s aspect ratio that could be a problem. You can also try with a half horizontal resolution (squashed) if the TV does not work well with full resolution frames in either Side by Side or Over/Under modes.

  • 75 Red // Jan 17, 2011 at 11:28

    Ok Bloody. Thank you for all your help. But no matter what settings I use (either in VDub or MediaCoder) to save the file or what dimensions the output should be – the result is always the same: 1440*304. Even when I set the output to Full HD ( 1920*1080) it will give me the above mentioned dimentions.
    Gratz to all that made it work for them. A shame I cant.. have quite a few movies i want in 3D :) ( 300, Iron Man, Ninja Assassin,…)

  • 76 Red // Jan 19, 2011 at 13:42

    Hello again. I managed to get a sort of 3D effect within Sony Begas 9. My question now is: What makes the AVS script giving the result the field of dept?

  • 77 GiB$0N // Jan 19, 2011 at 23:05

    Can someone give me a script or say how to use this script for 3D BluRay (L+R) -> Anaglyph???

  • 78 James // Feb 23, 2011 at 22:12

    I get an error message when trying to open the avisynth 2d to 3d script.

  • 79 Bloody // Feb 23, 2011 at 22:22

    James, what error message are you getting? Did you install the AviSynth executable?

  • 80 Rupam // Apr 20, 2011 at 13:10

    How would you convert an mp4 format video to an avi format video so that i could turn it into 3d? Or is there a different script for turning mp4 2d videos directly to 3d???

  • 81 Asharer // May 30, 2011 at 05:37

    wow… does it real?
    i still curious about 3D converter.

  • 82 Carling // Jun 27, 2011 at 00:06

    I managed to get it to play an mp4 file
    But when i tried again the next day it wouldnt play mp4

  • 83 Ridder // Aug 23, 2011 at 22:16

    high just converted a avi all good but movie plays in side by side how do i make it one screen ?

  • 84 techinfoall // Feb 5, 2012 at 13:53

    Is it working? any body tested here?

  • 85 aaditya // Mar 11, 2012 at 16:49

    can I use red/cyne blue glasses in my dell inspiron 1564 having i3 core processor, 4 gb ran and 512 mb ati graphics card?
    reply on my mail
    adityabrahmbhatt@yahoo.in

  • 86 Bloody // Mar 11, 2012 at 18:35

    Yes, you should have not trouble making anaglyph 3D glasses work.

Leave a Comment

Current ye@r *