How to make a 3d movie with ffmpeg: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= how to combine two seperate videos into one left-right 3d video =
= how to combine two seperate videos into one left-right 3d video =
1. Convert both movies to png still images
1. Convert both movies to png still images
:1.  ffmpeg -r 20 -i test01-left.avi -r 20 -s 640x480 frames-left/%09d.png
:1.  ffmpeg -i test01-left.avi frames-left/%09d.png
:2.  ffmpeg -r 20 -i test01-rigth.avi -r 20 -s 640x480 frames-right/%09d.png
:2.  ffmpeg -i test01-rigth.avi frames-right/%09d.png
2. Bash script for putting still images side by side, using imagemagick's montage command. script assumes 320x240 resolution.
2. Bash script for putting still images side by side, using imagemagick's montage command. script assumes 320x240 resolution.
<pre>
<pre>
Line 13: Line 13:
  done
  done
</pre>
</pre>
3. Convert images to avi
3a. Convert images to png avi losslessly (file will be as large as your image files)
:1.  ffmpeg -i %03d.png -an -vcodec copy -f avi outputfile.avi
:1.  ffmpeg -i %03d.png -an -vcodec copy outputfile.avi
3b. Convert images to mpeg4 avi
:1.  ffmpeg -i %03d.png -vtag XVID -an -vcodec mpeg4 outputfile.avi
 
=== references ===
http://www.google.co.nz/support/forum/p/youtube/thread?tid=57eeb22e76416a8b&hl=en
http://www.mtbs3d.com/phpbb/viewtopic.php?f=27&t=4521
http://electron.mit.edu/~gsteele/ffmpeg/

Revision as of 05:11, 22 October 2010

how to combine two seperate videos into one left-right 3d video

1. Convert both movies to png still images

1. ffmpeg -i test01-left.avi frames-left/%09d.png
2. ffmpeg -i test01-rigth.avi frames-right/%09d.png

2. Bash script for putting still images side by side, using imagemagick's montage command. script assumes 320x240 resolution.

 a=1 
 while [ $a -lt 2416 ]  
 do 
    b=`printf "%09d" $a` 
    montage frames-left/$b.png  frames-right/$b.png -geometry 320x240+0+0 frames-done/$b.jpg 
    let a++
 done

3a. Convert images to png avi losslessly (file will be as large as your image files)

1. ffmpeg -i %03d.png -an -vcodec copy outputfile.avi

3b. Convert images to mpeg4 avi

1. ffmpeg -i %03d.png -vtag XVID -an -vcodec mpeg4 outputfile.avi

references

http://www.google.co.nz/support/forum/p/youtube/thread?tid=57eeb22e76416a8b&hl=en
http://www.mtbs3d.com/phpbb/viewtopic.php?f=27&t=4521
http://electron.mit.edu/~gsteele/ffmpeg/