Transcode VR180 Video Using FFmpeg v360 and stereo3d
This guide explains how to process and transcode stereoscopic VR180
video using FFmpeg’s stereo3d and v360
filters. You will learn how to extract individual stereoscopic views,
apply projection transformations (such as converting between fisheye and
half-equirectangular projections), and remux the final output into a
standard format ready for VR headsets or standard displays.
Understanding the Pipeline
A standard VR180 video consists of two half-spherical views (left eye and right eye) arranged side-by-side (SBS) or top-bottom (above-below).
Transcoding VR180 using both filters involves a three-step pipeline:
- Stereo Separation (
stereo3d): Isolates the left and right eye streams from the source layout. - Spherical Projection Transformation
(
v360): Transforms each eye independently from its source projection (e.g., dual fisheye) into the target projection (e.g., equirectangular or half-equirectangular). - Recombination: Merges the two transformed eyes back into a single stereoscopic frame (SBS or top-bottom).
Method 1: Converting VR180 Fisheye to Equirectangular Side-by-Side
Most VR180 cameras (such as the Canon dual fisheye or Insta360 EVO)
capture footage in a dual-fisheye format. To convert this into standard
half-equirectangular (hequirect) or full equirectangular
(equirect) Side-by-Side video:
ffmpeg -i input_vr180_fisheye.mp4 -filter_complex \
"[0:v]stereo3d=in=sbsl:out=ml[left_raw]; \
[0:v]stereo3d=in=sbsl:out=mr[right_raw]; \
[left_raw]v360=input=fisheye:output=hequirect:ih_fov=180:iv_fov=180[left_rect]; \
[right_raw]v360=input=fisheye:output=hequirect:ih_fov=180:iv_fov=180[right_rect]; \
[left_rect][right_rect]hstack=inputs=2[v]" \
-map "[v]" -map 0:a? -c:v libx264 -crf 18 -preset slow -c:a copy output_vr180_sbs.mp4Breakdown of Filters:
stereo3d=in=sbsl:out=ml: Takes the side-by-side left-eye-first input (sbsl) and extracts only the left eye as a mono frame (ml).stereo3d=in=sbsl:out=mr: Takes the same input and extracts the right eye (mr).v360=input=fisheye:output=hequirect:ih_fov=180:iv_fov=180: Converts the circular 180° field-of-view fisheye stream into a half-equirectangular projection.hstack=inputs=2: Horizontally stacks the left and right equirectangular streams side by side.
Method 2: Converting VR180 SBS to Top-Bottom (Above-Below) Layout
If your playback platform or editing software requires a top-bottom
(over-under) format instead of side-by-side, use stereo3d
to remap the layout after applying any required spherical corrections
with v360:
ffmpeg -i input_vr180_sbs.mp4 -filter_complex \
"[0:v]v360=input=hequirect:output=hequirect:yaw=0:pitch=0:roll=0:in_stereo=sbs:out_stereo=sbs, \
stereo3d=in=sbsl:out=abl[v]" \
-map "[v]" -map 0:a? -c:v libx265 -crf 20 -preset medium -c:a copy output_vr180_tab.mp4in_stereo=sbs:out_stereo=sbs: Instructsv360to apply spherical adjustments (such as leveling horizon viayaw,pitch, orroll) across both eyes simultaneously.stereo3d=in=sbsl:out=abl: Converts the side-by-side layout directly into above-below left-eye-first (abl).
Method 3: Converting VR180 to Anaglyph 3D (Red/Cyan) for Standard Screens
To preview VR180 content on a traditional 2D monitor using red/cyan
3D glasses, use v360 to flatten the 180° sphere into a
rectilinear view, then merge the streams with stereo3d:
ffmpeg -i input_vr180_sbs.mp4 -filter_complex \
"[0:v]stereo3d=in=sbsl:out=ml[left]; \
[0:v]stereo3d=in=sbsl:out=mr[right]; \
[left]v360=input=hequirect:output=rectilinear:h_fov=100:v_fov=70[left_flat]; \
[right]v360=input=hequirect:output=rectilinear:h_fov=100:v_fov=70[right_flat]; \
[left_flat][right_flat]hstack=inputs=2,stereo3d=in=sbsl:out=arcm[v]" \
-map "[v]" -map 0:a? -c:v libx264 -crf 18 output_anaglyph.mp4output=rectilinear: Converts the curved equirectangular field of view into a flat camera perspective.h_fov=100:v_fov=70: Sets the horizontal and vertical field of view to standard viewing angles.stereo3d=in=sbsl:out=arcm: Blends the two views into red/cyan anaglyph color format (arcm).
Injecting Spatial Metadata
FFmpeg outputs standard video files. For VR platforms (such as YouTube or Meta Quest headsets) to recognize the video as VR180, you must inject stereoscopic spherical metadata into the MP4 container.
Use the spatial-media tool or enable FFmpeg's
stereoscopic container disposition where supported:
ffmpeg -i output_vr180_sbs.mp4 -c copy -disposition:v:0 +stereo output_flagged.mp4