公式のフィルタではなく Facebook の github レポジトリで公開したフィルタ。
Next-generation video encoding techniques for 360 video and VR | Engineering Blog | Facebook Code | Facebook
facebook/transform
インストール方法は Building に書いてあるので省略。
Windows 64bit 用のffmpeg サンプル。ffplay も同梱
ffmpeg version 2.8.git Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.9.3 (GCC) configuration: --cross-prefix=x86_64-w64-mingw32- --enable-version3 --enable-cross-compile --enable-gpl --enable-libx264 --disable-ffprobe --disable-ffserver --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-debug --target-os=mingw32 --arch=x86_64 --cpu=x86_64 libavutil 55. 14.100 / 55. 14.100 libavcodec 57. 22.100 / 57. 22.100 libavformat 57. 22.100 / 57. 22.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 27.100 / 6. 27.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100
基本コマンド
ffplay -i input.mp4 -vf transform=input_stereo_format=MONO:w_subdivisons=4:h_subdivisons=4:max_cube_edge_length=512
Facebook の記事より画像を引用
ffmpeg -h filter=transform
でオプションを調べられるがそれなりに設定項目がある。引数を何もつけないとクラッシュするバグがある。おそらくmax_cube_edge_length
が既定値 0 なのに 16 未満だとクラッシュするようだ。
transform AVOptions: w..FV.... Output video width width ..FV.... Output video width h ..FV.... Output video height height ..FV.... Output video height cube_edge_length ..FV.... Length of a cube edge (for cubic transform, overrides w and h, default 0 for off) (from 0 to 16384) (default 0) max_cube_edge_length ..FV.... Max length of a cube edge (for cubic transform, overrides w, h, and cube_edge_length, default 0 for off) (from 0 to 16384) (default 0) input_stereo_format ..FV.... Input video stereo format (from 0 to 3) (default GUESS) TB ..FV.... LR ..FV.... MONO ..FV.... GUESS ..FV.... tb ..FV.... lr ..FV.... mono ..FV.... guess ..FV.... output_layout ..FV.... Output video layout format (from 0 to 8) (default CUBEMAP_32) CUBEMAP ..FV.... CUBEMAP_32 ..FV.... CUBEMAP_180 ..FV.... PLANE_POLES ..FV.... PLANE_POLES_6 ..FV.... PLANE_POLES_CUBEMAP ..FV.... PLANE_CUBEMAP ..FV.... PLANE_CUBEMAP_32 ..FV.... FLAT_FIXED ..FV.... cubemap ..FV.... cubemap_32 ..FV.... cubemap_180 ..FV.... plane_poles ..FV.... plane_poles_6 ..FV.... plane_poles_cubemap ..FV.... plane_cubemap ..FV.... plane_cubemap_32 ..FV.... flat_fixed ..FV.... vflip ..FV.... Output video 2nd eye vertical flip (true, false) (from 0 to 1) (default false) false ..FV.... true ..FV.... main_plane_ratio ..FV.... Output video main plain ratio for PLANE_POLES format (0.88888) (from 0 to 1) (default 0.888889) expand_coef ..FV.... Expansion coeffiecient for each face in cubemap (default 1.01) (from 0 to 10) (default 1.01) w_subdivisons ..FV.... Number of horizontal per-pixel subdivisions for better downsampling (default 8) (from 1 to 8) (default 8) h_subdivisons ..FV.... Number of vertical per-pixel subdivisions for better downsampling (default 8) (from 1 to 8) (default 8) yaw ..FV.... View orientation for flat_fixed projection, degrees (from -360 to 360) (default 0) pitch ..FV.... View orientation for flat_fixed projection, degrees (from -90 to 90) (default 0) hfov ..FV.... Horizontal field of view for flat_fixed projection, degrees (default 120) (from -360 to 360) (default 120) vfov ..FV.... Vertical field of view for flat_fixed projection, degrees (default 110) (from -180 to 180) (default 110)