Split Stereoscopic 3D Video Using FFmpeg
Stereoscopic 3D videos typically store separate perspectives for the left and right eyes either by packing them into a single frame layout—such as Side-by-Side (SBS) or Top-and-Bottom (TAB)—or by packaging them as discrete video streams within a single container. This guide demonstrates how to use FFmpeg to identify the structure of your 3D video and isolate the left and right eye channels into individual, independent video files using spatial cropping filters or container stream mapping.
Determining Video Structure
Before extracting frames, verify whether your 3D video uses separate
video streams or a single frame-packed layout by running
ffprobe:
ffprobe -v error -show_entries stream=index,codec_type,width,height -of default=noprint_wrappers=1 input.mp4- If the output displays two separate video streams (e.g.,
codec_type=videolisted twice), the file contains dedicated tracks. - If only one video stream appears with unusually wide dimensions (e.g., 3840x1080) or tall dimensions (e.g., 1920x2160), it is a packed Side-by-Side or Top-and-Bottom format.
Extracting from Frame-Packed Videos (Crop Method)
Most consumer 3D videos combine both views into one frame. You can
isolate each channel using FFmpeg's crop filter.
Side-by-Side (SBS)
In SBS format, the left half of the frame corresponds to the left eye, and the right half corresponds to the right eye.
To extract the left eye:
ffmpeg -i input_sbs.mp4 -vf "crop=iw/2:ih:0:0" -c:a copy left.mp4To extract the right eye:
ffmpeg -i input_sbs.mp4 -vf "crop=iw/2:ih:iw/2:0" -c:a copy right.mp4To extract both views simultaneously in a single command:
ffmpeg -i input_sbs.mp4 -filter_complex "[0:v]crop=iw/2:ih:0:0[left];[0:v]crop=iw/2:ih:iw/2:0[right]" -map "[left]" -c:a copy left.mp4 -map "[right]" -an right.mp4Note: If dealing with Half-SBS (where horizontal resolution is
squeezed by 50%), you can restore the original aspect ratio by appending
a scale filter:
-vf "crop=iw/2:ih:0:0,scale=2*iw:ih".
Top-and-Bottom (TAB / Over-Under)
In TAB format, the top half represents the left eye, and the bottom half represents the right eye.
To extract the left eye (top):
ffmpeg -i input_tab.mp4 -vf "crop=iw:ih/2:0:0" -c:a copy left.mp4To extract the right eye (bottom):
ffmpeg -i input_tab.mp4 -vf "crop=iw:ih/2:0:ih/2" -c:a copy right.mp4To extract both views in a single pass:
ffmpeg -i input_tab.mp4 -filter_complex "[0:v]crop=iw:ih/2:0:0[left];[0:v]crop=iw:ih/2:0:ih/2[right]" -map "[left]" -c:a copy left.mp4 -map "[right]" -an right.mp4Extracting from Multi-Stream 3D Containers
If the file contains two independent video streams (common in raw
Blu-ray 3D rips or specialized production containers), extraction does
not require re-encoding. You can demux them directly using the
-map parameter.
To extract the streams simultaneously:
ffmpeg -i input_multitrack.mkv -map 0:v:0 -c copy left.mkv -map 0:v:1 -c copy right.mkv-map 0:v:0selects the first video stream (typically Left eye).-map 0:v:1selects the second video stream (typically Right eye).-c copypasses the video data directly to the new file without recompression, ensuring zero quality loss and near-instant processing.