Convert Side-by-Side 3D to Anaglyph with FFmpeg

This guide explains how to convert a side-by-side (SBS) 3D video into a red-cyan anaglyph video using FFmpeg's powerful stereo3d video filter. You will learn the exact command-line syntax, understand the input and output parameters, and explore different anaglyph rendering styles, such as color, grayscale, and Dubois.

The Basic FFmpeg Command

To convert a standard side-by-side 3D video to a red-cyan anaglyph video, use the following FFmpeg command:

ffmpeg -i input_sbs.mp4 -vf "stereo3d=in=sbsl:out=arcd" -c:a copy output_anaglyph.mp4

Parameter Breakdown:

  • -i input_sbs.mp4: Specifies your input side-by-side 3D video file.
  • -vf "stereo3d=...": Calls the stereo 3D filter.
  • in=sbsl: Defines the input format. sbsl stands for "side-by-side left first" (full resolution). If your input is half-width SBS (the most common format for 3D torrents and media files), change this to sbs2l.
  • out=arcd: Defines the output format. arcd stands for "anaglyph red/cyan Dubois", which is the highly recommended format as it uses a specialized algorithm to reduce ghosting and optimize colors.
  • -c:a copy: Copies the audio stream without re-encoding to save time and preserve quality.

Choosing Your Input Format (in)

You must match the in parameter to your source video's specific layout:

Value Description
sbsl Side-by-side full width, left eye first.
sbsr Side-by-side full width, right eye first.
sbs2l Side-by-side half width (half resolution), left eye first.
sbs2r Side-by-side half width (half resolution), right eye first.

For most downloaded 3D MKV or MP4 files, sbs2l is the correct choice.


Choosing Your Output Format (out)

FFmpeg supports several styles of red-cyan anaglyph. Choose the one that best fits your viewing preference:

This method uses a color-matching matrix to minimize eye strain and visual "ghosting."

ffmpeg -i input.mp4 -vf "stereo3d=in=sbs2l:out=arcd" output.mp4

2. Full Color Red/Cyan

This preserves the original colors as much as possible, though it can cause more ghosting/crosstalk.

ffmpeg -i input.mp4 -vf "stereo3d=in=sbs2l:out=arcc" output.mp4

3. Grayscale (Monochrome) Red/Cyan

This removes all color, resulting in a black-and-white image that provides a very clean, high-contrast 3D depth effect with almost zero ghosting.

ffmpeg -i input.mp4 -vf "stereo3d=in=sbs2l:out=arbg" output.mp4

Advanced Example with Video Encoding

If you want to compress the final output and ensure compatibility with most media players, encode the video using the H.264 codec:

ffmpeg -i input_sbs.mp4 -vf "stereo3d=in=sbs2l:out=arcd" -c:v libx264 -crf 20 -preset fast -c:a aac -b:a 192k output_anaglyph.mp4
  • -c:v libx264: Encodes the video to H.264.
  • -crf 20: Controls quality (lower values mean higher quality; 18–22 is ideal).
  • -c:a aac -b:a 192k: Converts the audio to high-quality AAC at 192 kbps.