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

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
 
(update info. why cant i find this page searching for 3d ??)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
= how to combine two seperate videos into one left-right video =
= how to combine two seperate videos into one left-right 3d video =
#Convert both movies to png still images
##  ffmpeg -r 20 -i test01-left.avi -r 20 -s 640x480 frames-l/%09d.png
##  ffmpeg -r 20 -i test01-rigth.avi -r 20 -s 640x480 frames-r/%09d.png


#Putting still images side by side, using imagemagick's montage command
== just want to play two files side by side ==
ffplay -i inputleft.avi -vf "movie=inputright.avi [in1]; [in]pad=iw*2:ih:iw:0[in0]; [in0][in1] overlay=0:0 [out]"
 
== combine seperate videos into one, side by side ==
ffmpeg -i inputleft.avi -vf "movie=inputright.avi [in1]; [in]pad=iw*2:ih:iw:0[in0]; [in0][in1] overlay=0:0 [out]"  sidebyside.avi
 
 
MORE INFO:
http://stackoverflow.com/questions/9293265/ffmpeg-2-videos-transcoded-and-side-by-side-in-1-frame
http://stackoverflow.com/questions/7581665/multiple-video-sources-combined-into-one
 
 
 
== old instructions ==
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.
<pre>
<pre>
  a=1  
a=1  
  while [ $a -lt 2416 ]   
while [ $a -lt 2416 ]   
  do  
do  
    b=`printf "%09d" $a`  
    b=`printf "%09d" $a`  
    montage frames-l/$b.png  frames-r/$b.png -geometry 320x240+0+0 frames/$b.jpg  
    montage frames-left/$b.png  frames-right/$b.png -geometry 320x240+0+0 frames-done/$b.jpg  
    let a++
    let a++
  done
done
</pre>
</pre>
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


#Convert images to avi
=== references ===
## ffmpeg -i %03d.jpg -acodec copy -vcodec copy -f avi outputfile.avi
  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/

Latest revision as of 02:57, 27 December 2012

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

just want to play two files side by side

ffplay -i inputleft.avi -vf "movie=inputright.avi [in1]; [in]pad=iw*2:ih:iw:0[in0]; [in0][in1] overlay=0:0 [out]"

combine seperate videos into one, side by side

ffmpeg -i inputleft.avi -vf "movie=inputright.avi [in1]; [in]pad=iw*2:ih:iw:0[in0]; [in0][in1] overlay=0:0 [out]" sidebyside.avi


MORE INFO: http://stackoverflow.com/questions/9293265/ffmpeg-2-videos-transcoded-and-side-by-side-in-1-frame http://stackoverflow.com/questions/7581665/multiple-video-sources-combined-into-one


old instructions

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/