How to Convert Side-by-Side to Anaglyph with FFmpeg

This article explains how to use the stereo3d filter in FFmpeg to convert a side-by-side (SBS) 3D video into an anaglyph format, allowing you to view 3D content on standard monitors using classic red-cyan glasses. You will learn the correct command-line syntax, the distinction between half-width and full-width inputs, and how to choose the best anaglyph output method for your needs.

To convert a side-by-side video to anaglyph, you must use FFmpeg’s video filter flag (-vf) followed by the stereo3d filter. The basic syntax requires you to define the input format and your desired output format:

ffmpeg -i input.mp4 -vf "stereo3d=input_format:output_format" output.mp4

1. Identifying Your Input Format

Before running the command, you need to know if your side-by-side video is “half-width” (most common for downloaded 3D media) or “full-width” (where each eye’s frame is stored at full resolution).

2. Choosing Your Output Anaglyph Format

FFmpeg supports several anaglyph output variations. The most common are red-cyan, but you can choose how colors are processed:

3. Example Commands

Convert Half-Width SBS to Red/Cyan Dubois Anaglyph (Recommended) This command takes a standard half-width SBS video and converts it to a high-quality red-cyan anaglyph using the Dubois algorithm:

ffmpeg -i input_sbs.mp4 -vf "stereo3d=sbs2l:arcd" output_anaglyph.mp4

Convert Full-Width SBS to Full-Color Red/Cyan Anaglyph If your source video is full-resolution SBS and you want to preserve maximum color vibrancy, use this command:

ffmpeg -i input_full_sbs.mp4 -vf "stereo3d=sbsl:arcc" output_anaglyph.mp4

Hardware Acceleration (Optional)

Because video encoding can be CPU-intensive, you can add your preferred video encoder to speed up the process. For example, to use NVIDIA hardware acceleration (NVENC), append the H.264 encoder to your command:

ffmpeg -i input_sbs.mp4 -vf "stereo3d=sbs2l:arcd" -c:v h264_nvenc output_anaglyph.mp4