Transform360 is a video/image filter that transforms a 360 video from one projection to another. Usually, the input projection is equirectangular and the output projection is cubemap. We also keep the previous version of the transform, Transform_V1, in the file vf_transform_v1.c
Transform360 is implemented in C++ and is invoked by ffmpeg video filter. To build and use Transform360, follow these steps (special thanks to https://github.com/danrossi):
transform360
ffmpeg
sourcesudo apt-get install ffmpeg
sudo apt-get install libopencv-dev
sudo apt-get install nasm libxvidcore-dev libass-dev libfdk-aac-dev libvpx-dev libx264-dev
Transform360
folder:cmake ./
make
sudo make install
vf_transform360.c
to the libavfilter
subdirectory in ffmpeg source.libavfilter/allfilters.c
and register the filter by adding the following line in the video filter registration section:extern AVFilter ff_vf_transform360;
For older ffmpeg versions (i.e., if you see existing filters are registered with REGISTER_FILTER), please instead add
REGISTER_FILTER(TRANSFORM360, transform360, vf);
libavfilter/Makefile
and add the filter to adding the following line in the filter section:OBJS-$(CONFIG_TRANSFORM360_FILTER) += vf_transform360.o
vf_transform360.c
in libavfilter
folderChange the include path from
#include "transform360/VideoFrameTransformHandler.h"
#include "transform360/VideoFrameTransformHelper.h"
to
#include "Transform360/Library/VideoFrameTransformHandler.h"
#include "Transform360/Library/VideoFrameTransformHelper.h"
./configure --prefix=/usr/local/transform/ffmpeg --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencv --extra-libs='-lTransform360 -lstdc++'
make
./ffmpeg
or by installing it with make install
Check out the options for the filter by running ffmpeg -h filter=transform360
.
A typical example looks something like:
ffmpeg -i input.mp4
-vf transform360="input_stereo_format=MONO
:cube_edge_length=512
:interpolation_alg=cubic
:enable_low_pass_filter=1
:enable_multi_threading=1
:num_horizontal_segments=32
:num_vertical_segments=15
:adjust_kernel=1"
output.mp4
Transform is implemented as an ffmpeg video filter. To build Transform, follow these steps:
vf_transform_v1.c
to the libavfilter subdirectory in ffmpeg source.libavfilter/allfilters.c
and register the filter by adding the
line: extern AVFilter ff_vf_transform_v1;
For older ffmpeg versions
(i.e., if you see existing filters are registered with REGISTER_FILTER),
please instead add REGISTER_FILTER(TRANSFORM_V1, transform_v1, vf);
in the video filter registration section.libavfilter/Makefile
and add the filter to adding the
line: OBJS-$(CONFIG_TRANSFORM_V1_FILTER) += vf_transform_v1.o
in the filter section.Check out the options for the filter by running ffmpeg -h filter=transform_v1
.
A typical example looks something like:
ffmpeg -i input.mp4
-vf transform_v1="input_stereo_format=MONO
:w_subdivisions=4
:h_subdivisions=4
:max_cube_edge_length=512"
output.mp4
Transform360 and Transform_V1 are BSD licensed, as found in the LICENSE file.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。