12

I am looking for a way to convert a 3d movie to a 2d movie.

I found a reference on this forum. http://www.ffmpeg-archive.org/How-to-re-encode-3d-video-to-2d-video-td4676271.html

3 Answers 3

13

While you might be able to achieve this by manually using ffmpeg's crop filter, the stereo3d filter is designed specifically for this purpose. You didn't specify the exact 3d format you have. There are several possibilities as documented at the the stereo3d link above. Assuming that input.mkv is the relatively common sbsl (side-by-side left eye on left),

ffmpeg -i input.mkv -vf stereo3d=sbsl:ml -metadata:s:v:0 stereo_mode="mono" output.mkv

will result in a 2d (left eye only) output.mkv. I believe the reason -metadata:s:v:0 stereo_mode="mono" is required to remove the stereo tag is because the metadata isn't piped through the filter system, and ffmpeg otherwise tries to duplicate the metadata of the original. If you don't do this, some players may think your 2d result is still 3d and do weird things.

If you find that the result has the wrong aspect ratio, you can experiment with using stereo3d=sbsl2:ml instead which treats the input as half width side-by-side. If all else fails, you can set the correct aspect with -aspect 16:9 (or whatever you know the correct aspect ratio to be).

3
  • 1
    Could you explain the stereo3d filter option you are using here? I understand from the ffmpeg documentation that sbsl means side by side parallel (left eye left, right eye right) but what does the :ml signify? I can't seem to locate that information.
    – Elder Geek
    Oct 3, 2017 at 1:00
  • The syntax is stereo3d=<input-format>:<output-format>. As per the linked documentation, ml means to output "mono output (left eye only)".
    – kevmitch
    Oct 3, 2017 at 21:51
  • I got errors attempting to use -metadata:s:v:0 stereo_mode="mono" with ffmpeg 2.8.14. It appears that the documentation may have changed since you wrote this answer. Simply removing the aforementioned switches allowed ffmpeg to continue without error. Note that you can avoid re-encoding the audio stream by utilizing the -c:a copy switch.
    – Elder Geek
    Jul 25, 2018 at 18:08
2

I found a reference on this forum. http://www.ffmpeg-archive.org/How-to-re-encode-3d-video-to-2d-video-td4676271.html

ffmpeg -i './a3dmovie.mp4'  -vf "crop=w=iw/2:h=ih:x=0:y=0,scale=w=2*iw:h=ih,setdar=2" -y ./a2dmovie.mp4

The important part is the -vf "crop=w=iw/2:h=ih:x=0:y=0,scale=w=2*iw:h=ih,setdar=2"

It essentially halves the output and rescales as appropriate for the 3d video.

I found this is also useful to test and check the output

ffplay -i ./some3dmovie.mp4  -vf "crop=w=iw/2:h=ih:x=0:y=0,scale=w=2*iw:h=ih,setdar=2" 

You can move the index to the front of the file as follows -movflags faststart

2

As an adaption of kevmitch's answer, I went with

ffmpeg  -i "foo.mkv" -vf stereo3d=sbs2l:ml -c:a copy "bar.mp4"

Notable difference: It's using sbs2l (instead of sbsl2) and just copies audio streams (works for me). Further reading to stereo3d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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