2

I'm trying to take two input videos (can be in avi, mp4, whatever ffmpeg supports) and combine them into a stereoscopic video with the "ffmpeg" utility that uses simple red and cyan colored glasses (anaglyph). I have tried the following statements with input files of type mp4:

ffmpeg -i left.mp4  -i right.mp4          stereo3d=al:arcc  video_arcc.mp4
ffmpeg -i left.mp4  -vf "movie=right.mp4" stereo3d=al:arcc  video_arcc.avi

I see error messages like:

Error message: [NULL @ 0000000003220940] Unable to find a suitable output format for 'stereo3d=al:arcc'
stereo3d=al:arcc: Invalid argument

My source images are a series of JPEGs that I can convert to any input format. It would be preferrable to use left%06d.jpg" and "right%06d.jpg", but that is an extra layer of difficulty for now.

What command line options do I need for ffmpeg anaglyph red-cyan?

3

stereo3d is a video filter so it has to be specified via a filterchain or complex. Since you have two inputs, and stereo3d only converts a single input from one form of 3D arrangement to another, you'll have to combine the two image sequences first. For which, you can use the hstack filter, which will place the two sequences side-by-side.

So,

ffmpeg -i "left%06d.jpg" -i "right%06d.jpg" -filter_complex "hstack,stereo3d=sbsl:arcc" video_arcc.mp4

By default, image sequences are treated as 25 FPS and hence so will the output, in this case. If the framerate is different, say 24, then the beginning will be

ffmpeg -framerate 24 -i left%06d.jpg" -framerate 24 -i "right%06d.jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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