Difference between revisions of "SoC 2011/Stereoscopic Video"

From VideoLAN Wiki
Jump to navigation Jump to search
Line 109: Line 109:
 
|-
 
|-
 
| [[File:StereoRb.jpg]]
 
| [[File:StereoRb.jpg]]
|
+
| [[File:StereoRightbg.jpg]]
 
| blue-gray
 
| blue-gray
 
| The eye is encoded into the blue channel and returned as a grayscale image.
 
| The eye is encoded into the blue channel and returned as a grayscale image.
 
|-
 
|-
 
| [[File:StereoRc.jpg]]
 
| [[File:StereoRc.jpg]]
|
+
| [[File:StereoRightcg.jpg]]
 
| cyan-gray
 
| cyan-gray
 
| The eye is encoded into the blue and green channels of the image and returned as a grayscale image.
 
| The eye is encoded into the blue and green channels of the image and returned as a grayscale image.
 
|-
 
|-
 
| [[File:StereoRg.jpg]]
 
| [[File:StereoRg.jpg]]
|
+
| [[File:StereoRightgg.jpg]]
 
| green-gray
 
| green-gray
 
| The eye is encoded into the green channel of the image and returned as a grayscale image.
 
| The eye is encoded into the green channel of the image and returned as a grayscale image.
 
|-
 
|-
 
| [[File:StereoGm.jpg]]
 
| [[File:StereoGm.jpg]]
|
+
| [[File:StereoRightmg.jpg]]
 
| magenta-gray
 
| magenta-gray
 
| The eye is encoded into the red and blue channels of the image and returned as a grayscale image.
 
| The eye is encoded into the red and blue channels of the image and returned as a grayscale image.
 
|-
 
|-
 
| [[File:StereoRc.jpg]]
 
| [[File:StereoRc.jpg]]
|
+
| [[File:StereoLeftrg.jpg]]
 
| red-gray
 
| red-gray
 
| The eye is encoded into the red channel of the image and returned a grayscale image.
 
| The eye is encoded into the red channel of the image and returned a grayscale image.
Line 139: Line 139:
 
|-
 
|-
 
| [[File:StereoRc.jpg]]
 
| [[File:StereoRc.jpg]]
|
+
| [[File:StereoRightyg.jpg]]
 
| cyan-fill
 
| cyan-fill
 
| The eye is encoded into the blue and green channels of the image and returned as a full colour image. The missing red channel is filled in with the average of the blue and green channels.
 
| The eye is encoded into the blue and green channels of the image and returned as a full colour image. The missing red channel is filled in with the average of the blue and green channels.

Revision as of 10:55, 26 August 2011

This project is part of Google Summer of Code 2011.
Student: Andrew Price
Mentor: Jean-Baptiste Kempf

Building from Source

At the present state you must acquire the source code of the stereoscopic 3D branch and build it yourself. [1]

There are build instructions in a file named 'STEREOSCOPY README' but I'll also repeat the instructions here.

Build Environment

I use 32-bit MSYS/x86 Windows 7. To set up your build environment first follow through the instructions on [Win32CompileMSYSNew] to make sure you're able to build VLC successfully on your system.

The following build instructions should work on any Windows system.

Building

Create a new empty directory somewhere, and at the MSYS terminal type:

git pull git://github.com/MessiahAndrw/Stereoscopic-VLC.git

To bootstrap the build I use the following:

cd vlc
cp -v /usr/win32/share/aclocal/* m4/
cp -v /usr/share/aclocal/* m4/
PATH=/usr/win32/bin:$PATH ./bootstrap

Then to configure:

sh extras/package/win32/configure-msys.sh

Finally to build:

PATH=/usr/win32/bin:$PATH make package-win32 -j6

(The -j6 switch is optional and tells makefile to use 6 threads, it speeds up the build time on my 6-core machine.)

'make package-win32' will exit with the following error but that's normal and VLC has still been built:

cp: cannot stat `./npapi-vlc/installed/lib/npvlc.dll': No such file or directory

If everything else was successful you will now have built VLC with stereoscopic support! You will find this build in the directory 'vlc-1.2.0-git'.

Note on 3D Vision support

nVidia 3D Vision only activates for windowed-mode programs which are supported by the nVidia driver. At the present state VLC is not supported by the nVidia driver. However, the driver only performs a simple file-name check of the application, so as a workaround you can rename vlc.exe to the same file-name as a supported application. This can be done simply by:

cd vlc-1.2.0-git
mv vlc.exe wow.exe

Splitting

To play a stereoscopic 3D video you must tell the stereoscopy module how to get the image for each eye. The stereoscopic module is takes a 2D input picture, and produces 2 output pictures (one for the left eye, and one for the right eye).

Command line

To enable the stereoscopic module you should add the following command line parameters when you start vlc:

--video-filter="stereoscopy" --stereoscopy-left="<left>" --stereoscopy-right="<right>"

Where <left> and <right> are valid input formats (see the table below).

QT4

You can configure the stereoscopy module through the QT4 interface. To do this, open the 'Tools' menu and click on 'Effects and Filters'. In the 'Adjustments and Effects' dialog that opens navigate to the 'Video Effects' tab. Then find the sub-tab titled 'Stereoscopy'. Check 'Split' to enable the stereoscopy module to split the image into separate left and right frames. Select your video's input formats for the 'Left Eye and the 'Right Eye'.

StereoscopyoptionsQt4.png


Input formats

Source Extracted Image Format name Description
StereoRb.jpg StereoRightb.jpg blue The eye is encoded into the blue channel of the image and returned as a blue image.
StereoRc.jpg StereoRightc.jpg cyan The eye is encoded into the blue and green channels of the image returned as a cyan image.
StereoRg.jpg StereoRightg.jpg green The eye is encoded into the green channel of the image and returned as a green image.
StereoGm.jpg StereoRightm.jpg magenta The eye is encoded into the red and blue channels of the image returned as a magenta image.
StereoRc.jpg StereoLeftr.jpg red The eye is encoded into the red channel of the image and returned as a red image.
StereoBy.jpg StereoRighty.jpg yellow The eye is encoded into the red and green channels of the image returned as a yellow image.
StereoRb.jpg StereoRightbg.jpg blue-gray The eye is encoded into the blue channel and returned as a grayscale image.
StereoRc.jpg StereoRightcg.jpg cyan-gray The eye is encoded into the blue and green channels of the image and returned as a grayscale image.
StereoRg.jpg StereoRightgg.jpg green-gray The eye is encoded into the green channel of the image and returned as a grayscale image.
StereoGm.jpg StereoRightmg.jpg magenta-gray The eye is encoded into the red and blue channels of the image and returned as a grayscale image.
StereoRc.jpg StereoLeftrg.jpg red-gray The eye is encoded into the red channel of the image and returned a grayscale image.
StereoBy.jpg yellow-gray The eye is encoded into the red and green channels of the image and returned as a grayscale image.
StereoRc.jpg StereoRightyg.jpg cyan-fill The eye is encoded into the blue and green channels of the image and returned as a full colour image. The missing red channel is filled in with the average of the blue and green channels.
StereoGm.jpg magenta-fill The eye is encoded into the red and blue channels of the image and returned as a full colour image. The missing green channel is filled in with the average of the red and blue channels.
StereoBy.jpg yellow-fill The eye is encoded into the red and green channels of the image and returned as a full colour image. The missing blue channel is filled in with the average of the red and green channels.
StereoLr.jpg StereoLeft.jpg left The eye is encoded into the left half of the image. Assumes the source is half-SBS but the aspect ratio will need to be halved for full-SBS.
StereoLr.jpg StereoRight.jpg right The eye is encoded into the left half of the image. Assumes the source is half-SBS but the aspect ratio will need to be halved for full-SBS.
StereoTb.jpg StereoLeft.jpg top The eye is encoded into the right half of the image. Assumes the source is half-SBS but the aspect ratio will need to be halved for full-SBS.
StereoTb.jpg StereoRight.jpg bottom The eye is encoded into the bottom half of the image. Assumes the source is half-SBS but the aspect ratio will need to be halved for full-SBS.

Developer notes

picture_t contains a new field i_eye that is the eye the picture represents. Valid values at the moment are:

0 The picture is 2D.
1 The picture is destined for the left eye.
2 The picture is destined for the right eye.

The default value for i_eye is 0, and all present video codecs output frames where i_eye is 0. It is up to the stereoscopy module to split it into left and right. But it's possible for someone to develop a video codec that output pictures where i_eye>0, for example for a container format where the data is stored as separate left/right images. In this case the stereoscopy module does nothing, and forwards the pictures on as is.


nVidia 3D Vision

non-nVidia 3D Vision

Coming Soon

Trouble shooting=