Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I join the two parts of a stereoscopic movie to get a side-by-side one?

I can expand the left file, that way all I'll need is to paste the second one on top of it, with something like this:

mencoder left-file.mkv -o side-by-side.avi -oac copy -ovc lavc -of avi -vf scale=1280:720,expand=-1280:0:0:0 -sws 3 -lavcopts vbitrate=16000

Any idea which tool should I use on a Linux system?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

UPDATE - I've put a handy wrapper script around this and started a project at SourceForge. I've called it videomerge3d

http://videomerge3d.sourceforge.net/


Try GStreamer

I'm sure someone will put a nice wrapper on this functionality soon... in the meantime you can use the command line gst-launch program:

Replace my MVI_0735L.MOV and MVI_0735R.MOV with your files and out.avi with whatever you want it to be saved as.

To play movies ( reduced to (640x2)x320 views - can't play 2560x720 as my screen is too narrow ), non-linux might need to modify the 'xvimagesink' to something else.


gst-launch filesrc location=MVI_0736L.MOV ! decodebin2 name=LeftVid ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=640, height=360 ! videobox border-alpha=0 right=-640 ! videomixer name=mix ! ffmpegcolorspace ! xvimagesink filesrc location=MVI_0735R.MOV ! decodebin2 name=RightVid ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=640, height=360 ! videobox border-alpha=0 left=-640 ! mix. LeftVid. ! audioconvert ! audiopanorama panorama=-1.00 ! adder name=addaudio ! queue ! autoaudiosink  RightVid. ! audioconvert ! audiopanorama panorama=1.00 ! queue ! addaudio. 

To combine 720P movies:


gst-launch filesrc location=MVI_0735L.MOV ! decodebin name=Left ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=1280, height=720 ! videobox border-alpha=0 right=-1280 ! queue ! videomixer name=mix ! ffmpegcolorspace ! x264enc ! avimux name=avmux ! queue ! progressreport name="Encoding Progress" ! filesink location=out.avi filesrc location=MVI_0735R.MOV ! decodebin name=Right ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=1280, height=720 ! videobox border-alpha=0 left=-1280 ! queue ! mix.   Left. ! audioconvert ! audiopanorama panorama=-1.00 ! adder name=addaudio ! faac ! queue ! avmux.  Right. ! audioconvert ! audiopanorama panorama=1.00 ! queue ! addaudio. 

Here's a more readable version ( using \ to join the lines):


gst-launch-0.10 filesrc location=MVI_0735L.MOV ! decodebin2 name=Left \
                filesrc location=MVI_0735R.MOV ! decodebin2 name=Right \
 Left. ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=1280, height=720 ! videobox border-alpha=0 right=-1280 ! queue ! mix. \
 Right. ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv, width=1280, height=720 ! videobox border-alpha=0 left=-1280 ! queue ! mix.  \
 Left. ! decodebin2 ! audioconvert ! audiopanorama panorama=-1.00 ! queue ! addaudio. \
 Right. ! decodebin2 ! audioconvert ! audiopanorama panorama=1.00 ! queue ! addaudio. \
 adder name=addaudio ! faac ! avmux.  \
 videomixer name=mix ! ffmpegcolorspace ! x264enc ! \
 avimux name=avmux ! progressreport name="Encoding Progress" ! filesink location=out.avi
  • for other video compression replace x264enc with jpegenc etc.
  • for other audio compression replace faac with lame or just remove it alogether.
share|improve this answer
    
Thank you very much for your answer, JJones! I have GStreawer on my system, but I never knew it is capable of doing this... –  Attila O. Mar 19 '11 at 13:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.