# 3d Video Converter, SBS into Anaglyph with MS Expression Encoder 4

Last updated on May 10, 2013 @ 16 Comments

Convert video files in this case converting 3D SBS into Anaglyph can be done easily with Microsoft Expression Encoder 4. All we need is Avisynth and several additional plugins which will support the stereoscopic 3D video conversion. Although there are some commercial 3d video converter which is offering best and fast result, Microsoft Expression Encoder 4 bring the most reliable free video editor combined with Avisynth. But before we can start converting 3D SBS videos into anaglyph, several libraries and plugins need to be configured first.

Regarding to 3D SBS to Anaglyph conversion, you might also read my earlier post about playing 3D sbs as anaglyph with MPC. There also complete step by step tutorial with screenshot for it.

AviSynth is a powerful tool for video post-production. It provides ways of editing and processing videos. AviSynth works as a frameserver, providing instant editing without the need for temporary files (Avisynth Wiki).

Our 3D video converter work by encoding Avisynth scripts which contain Pantarheon 3DToolbox function. The script can be either a simple video referrer (converting non 3D video) or a video manipulation script with complex functions. But the more functions we put into the script, the more time will be used for encoder to convert the video.

## Softwares needed

If you’ve followed my earlier step-by-step configuring MPC for 3D videos, then this time you only need FFmpegSource, MS Expression Encoder 4 and the additional Notepad++ as the script editor. Since most of the others softwares are installed already on the earlier tutorial.

Download and install all listed softwares above except for FFmpegSource.  It have to be installed manually as shown by the following steps.

1. Extract FFmpegSource compressed file into a folder.

2. Copy all its content into Avisynth plugins directory (i.e. C:\Program Files\AviSynth 2.5\plugins).

3. This will make FFmpegSource auto-loaded every time an application execute Avisynth script.  The plugin is needed to load and synchronize video and Audio from source. It just an alternative for the default “DirectShowSource” function, since it giving me out of sync problem on audio every time.

## 3D H-SBS to Anaglyph Script

Run notepad++ or any text editor such as windows notepad. Write or copy the following codes into editor.

video = "D:\path\to_any_video_folder\video_name.mp4" FFIndex(video) SBS = AudioDub(FFVideoSource(video), FFAudioSource(video))   C = ConvertToRGB(SBS) w = C.width() h = C.height() LeftRight3DToRCAnaglyph(C).Lanczos4Resize(w, h)

As you can see the script was taken from the earlier post (anaglyph with MPC) with some additions. SBS video will be converted into Red/Cyan Anaglyph. Read my earlier post also for configuring Pantarheon AviSynth 3DToolbox on various Anaglyph colors.

Now change “D:\path\to_any_video_folder\video_name.mp4” into the real video file path. Save the script into avs file extension (i.e. my_video.avs).

Before continue to video encoding, we should first test the video with Media Player Classic (MPC HC). Just to make sure no error in the script.

Run MPC and open the avs file through File -> Open File menu -> Browse to saved avs folder and change file type into “All Files (*.*)” .So we can see all files in the folder including the avs script. Select avs file and click “OK“. MPC now should play the video.

Now that MPC show no error, we can start to convert video file using MS Expression Encoder.

## Import to Encoder

Open Microsoft Expression Encoder (on Program Files), and select Transcoding Project.

To open avs file click File menu and then Import (or CTRL+I). Browse to folder where the avs file saved, select the avs file and then click Open. Play the video for a while to see if the video playable on MS Expression Encoder.

## Encoder Setting

You can change the output video profile on the encode menu tab in the right side of MS expression encoder. On output tab you can set a folder for the encoded video output .Video output will automatically stored on a sub-folder named by time-stamps. And also for advanced configuration you can set Encoding Quality and Encoding for Devices for output file format and quality in the Presets menu.

Now click the “Encode” button on left bottom of the MS Express Encoder start encoding process. Encoding time may vary depends on many things such as video length, resolution and also the the computer resource it self. If encoding process finished you can then burn the video file into DVD, put into USB flash media and play it on non 3D TV, Laptop or maybe Mobile media such as Tablet or SmartPhones. Just remember to put on the Anaglyph glasses before watching the videos.

#### Article by M Riza

Is a blogger since 2007, founder and editor of Oa Ultimate. Working as a network administrator, computer technician, database and web maintainer | Twitter | G+

### 16 Comments → “3d Video Converter, SBS into Anaglyph with MS Expression Encoder 4”

1. saracen9

You could just use the following in your avisynth script which would negate the need for separate video and audio sources.

FFCopyrightInfringement(videoWithAudio.mp4)

Returns a clip with both the audio and video indexed and dubbed

Open up FFMS2.avsi and you will see it there, but not documented widely elsewhere

• M Riza

I’ll test about it and post an update later.
Thanks for letting me know.

2. Sandeep

Script Error there is no function named “FFIndex”

• M Riza

FFIndex is part of FFmpegSource (in this article v 2.17). Make sure you put the plugin on the right place (plugin folder). Otherwise try load the plugin manually within the script:
LoadPlugin("z:\path-to\ffms2.dll")
Put it on the first line.

• JP

Sandeep,
Did you ever get this working?

3. Jayan Cahamal

how we do if it is Up And down side by side . you instruction for only Left right ..
can you tell me the codes for up and down Anaglyph video

4. JP

I get an unexpected character “A” (c:\test.avs, line 7, column 38)
I also am curious if the process is the same for video that is formatted with an upper video and lower? I assume we would just swap the one line out at the bottom with the TopDown3DToRCAnaglyph versus the original LeftRight3DToRCAnaglyph.
Any help would be appreciated.
thanks!

• JP

I copied the script from above and there was a typo in the last line. I corrected it and now get a different error…. I get a script error: there is not function named “FFIndex” (C:\test.avs, line 2)
Here is my script:
video = "C:\RIPD.mkv" FFIndex(video) SBS = AudioDub(FFVideoSource(video), FFAudioSource(video)) C = ConvertToRGB(SBS) w = C.width() h = C.height() TopDown3DToRCAnaglyph(c).Lanczos4Resize(w,h)
Any help is much appreciated!

• JP

I forgot to add that i did try loading the plugin manually as you mentioned to Sandeep.

• M Riza

Hi, it seems that FFmpegSource plugin is not loaded properly on your Avisynth. Try paste all FFmpegSource files into Avisynth plugin folder.

• JP

The following files are from the FFmpegSource site you included above are located in the install folder of AVISYNTH (C:\Program Files\AviSynth 2.5\plugins):
FFMS2.AVSI
FFMS2.DLL
FFMSINDEX.EXE

I also include the following line at the beginning of the script in an effort to load the plugin:

I am running Windows 7 32bit.
Thanks for the fast response!

• JP

Update:
I downloaded a different version from the FFmpegSource site and overwrote the files again in the plugin folder. I now no longer get the error. The file loads successfully but only shows 10 minutes of nothing (just black square with no audio). Maybe this is because the file type is MKV? Thoughts?

• M Riza

MKV should not be a problem i guess. You can try convert it to MP4 just to make sure. Btw, have you set “Raw Video” to “All Supported” on ffdshow setting?

• JP

I didn’t have ffdshow installed. I installed it and it now opens fine and opens correctly. I am sorry… Last Question, did you buy Encoder from Microsoft in order to export to mp4? I can only choose Windows Media and not MP4

5. JP

The video seems to work perfectly but I get an error when opening the file in MPC-HC. The error is an audio error. The video plays but has no audio. Some of the Error:

AVI/WAV File Source::Avisynth audio #1
ACM Wrapper::Output

Media Type 0:
————————–
Audio: PCM 48000Hz 6ch 4608kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 12
cbFormat: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 6
nSamplesPerSec: 48000
nAvgBytesPerSec: 576000
nBlockAlign: 12
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 01 00 06 00 80 bb 00 00 00 ca 08 00 0c 00 10 00 ….€»…Ê……
0010: 00 00