Transcode VR180 Video Using FFmpeg v360 and stereo3d
This guide explains how to transcode VR180 (half-spherical
stereoscopic) video files using the powerful v360 and
stereo3d filters in FFmpeg. You will learn how to
manipulate VR180 formats—which are typically stored as side-by-side or
over-under half-equirectangular projections—to convert them into
standard 2D flat videos, change their stereoscopic layouts, or reproject
them into different 3D formats.
Understanding the Filters
To transcode VR180 video, you must handle two aspects: the 3D stereoscopic layout (left and right eye views) and the 360-degree geometry projection (usually half-equirectangular).
stereo3d: This filter converts stereoscopic formats. It defines how the left and right eye images are packaged (e.g., side-by-side, above-below, or single-eye mono).v360: This filter handles projection conversions. For VR180, the input projection is typicallyhequirect(half-equirectangular). You can convert this projection toflat(for standard displays),equirect(full 360), or other spherical mappings.
Scenario 1: Converting VR180 to a Flat 2D Video
If you want to convert a 3D VR180 side-by-side (SBS) video into a standard, flat 2D video that can be viewed on any normal screen, you must first extract one eye’s view and then convert the spherical projection to a flat projection.
Run the following command:
ffmpeg -i input_vr180.mp4 -vf "stereo3d=sbsl:ml,v360=input=hequirect:output=flat:h_fov=90:v_fov=60:yaw=0:pitch=0" output_2d.mp4How it works:
stereo3d=sbsl:ml: Takes a side-by-side left-eye-first (sbsl) input and outputs only the mono left (ml) eye channel, discarding the right eye.v360=input=hequirect:output=flat: Takes the half-equirectangular (hequirect) image and projects it onto a flat, perspective plane (flat).h_fov=90:v_fov=60: Sets the horizontal Field of View to 90 degrees and the vertical to 60 degrees. Adjust these numbers to zoom in or out.yaw=0:pitch=0: Defines the camera direction. You can change these angles to “pan” the camera to a different part of the 180-degree field.
Scenario 2: Processing 3D VR180 while Preserving the 3D Format
If you want to apply the v360 filter (for example, to
change the field of view, adjust the rotation, or convert to a different
projection) while keeping the video in 3D stereoscopic format, you
cannot apply the filter to the entire side-by-side frame at once. Doing
so would warp the boundary between the two eyes.
Instead, you must split the video into left and right eyes, apply the
v360 filter to each eye independently, and then merge them
back together.
Run the following command:
ffmpeg -i input_vr180.mp4 -filter_complex \
"[0:v]split[left_in][right_in]; \
[left_in]crop=iw/2:ih:0:0,v360=input=hequirect:output=flat:h_fov=90:v_fov=60[left_out]; \
[right_in]crop=iw/2:ih:iw/2:0,v360=input=hequirect:output=flat:h_fov=90:v_fov=60[right_out]; \
[left_out][right_out]hstack" \
output_3d_flat.mp4How it works:
split[left_in][right_in]: Duplicates the input video stream into two identical pathways.crop=iw/2:ih:0:0: Crops the left half of the video (the left eye).crop=iw/2:ih:iw/2:0: Crops the right half of the video (the right eye).v360=...: Independently applies the projection transform to each eye. In this example, it transforms both eyes from half-equirectangular to flat perspective.hstack: Horizontally stacks the processed left and right eye streams back into a single side-by-side 3D video.
Scenario 3: Changing Stereoscopic Layout (SBS to Top-Bottom)
If your VR180 video is side-by-side and you need to convert it to an
over-under (top-bottom) format without changing the underlying spherical
projection, use the stereo3d filter alone:
ffmpeg -i input_sbs.mp4 -vf "stereo3d=in=sbsl:out=abl" output_top_bottom.mp4in=sbsl: Specifies the input is side-by-side, left eye first.out=abl: Converts the output to above-below, left eye first.