Sunday, January 15, 2012

SBS/polarized/stereo 3d to alaglyph/red, blue 3d

If you have a SBS (side by side)/polarized/3d video, and you want to get the 3d effect without owning a 3d monitory (capable of producing polarized light), you can do so with the classic red-blue anaglyph 3d glasses; but first you have to convert the video to red/blue 3d format. You can use ffmpeg to do so.

ffmpeg has the capability to use mplayer/mencoder filter with -

ffmpeg -vf mp=[the mplayer filter]

The stereo3d filter of mplayer does the trick here, it converts sbs to anaglyph 3d, and I have to say conversion is good!

e.g. -

ffmpeg -i sbs.mp4 -vf mp=stereo3d -acodec copy -threads 10 -b:v 10000k -preset ultrafast -vcodec libx264 ~/test2.mkv

You can also use mplayer to play the SBS video by converting it to anaglyph in real time using the same video filter -


mplayer -vf stereo3d -vo gl_nosw/gl/gl2

The video driver has to be some form of gl for this to work. If you want to use xv, use the scale filter also -

mplayer -vf stereo3d,scale -vo xv

To get this working in smplayer, in the advanced options > options for mplayer > video filters

add -

stereo3d

to the filter chain.

Also you need to change the video output driver to gl/gl2 etc... if you're not adding the scale filter.

You need the latest mplayer for conversion to be fast. If it still doesn't work, you may try out mplayer2.

1 comment:

  1. In fedora 19 it seems like:
    ffmpeg -i sbs.mp4 -vf stereo3d -acodec copy -threads 10 -b:v 10000k -preset ultrafast -vcodec libx264 ~/test2.mkv

    ReplyDelete