Transform is a video filter that transforms 360 video in equirectangular projection into a cubemap projection
Transform is implemented as an ffmpeg video filter. To build Transform, follow these steps:
- Checkout the source for ffmpeg
- Copy
vf_transform.c
to the libavfilter subdirectory in ffmpeg source - Edit
libavfilter/allfilters.c
and register the filter by adding the line:REGISTER_FILTER(TRANSFORM, transform, vf);
in the video filter registration section - Edit
libavfilter/Makefile
and add the filter to adding the line:OBJS-$(CONFIG_TRANSFORM_FILTER) += vf_transform.o
in the filter section - Configure and build ffmpeg as usual
Check out the options for the filter by running ffmpeg -h filter=transform
A typical execution would be something like ffmpeg -i input.mp4 -vf transform='input_stereo_format=MONO:w_subdivisons=4:h_subdivisons=4:max_cube_edge_length=512' output.mp4