Tuesday, March 31, 2020

tool for converting 360 videos to fulldome - OCVWarp and ffmpeg's v360 filter

Paul Bourke had recently announced a real-time video playback tool which can convert and play equirectangular 360 videos as fisheye videos on domes like planetariums. 

OCVWarp can currently convert equirectangular 360 videos to fisheye videos offline - fisheye videos with 180 degree field of view would be suitable for projecting in a planetarium - fulldome videos. While the field of view is fixed at 180 degrees, the direction of viewing can be changed interactively, or by setting parameters in the ini file. This tool is useful for those who have lower powered machines which cannot handle hi-res video processing in real-time, and also for Windows and Linux users.

Here are links to OCVWarp's
Source code
Linux AppImage
Windows commandline-only executable with some restrictions.

Usage notes and bare basic compile instructions are in the readme.

Some examples, using input files found using google - these are transformations from Equirectangular to 180 degree fisheye, Type=1 in the ini file.

Input -



Output with constant parameters of anglex=0 and angley=-90 -



Output with anglex being changed by pressing 'h' once every second or so -



Output with anglex changed every frame, by keeping 'h' pressed -



Recalculation of the map files is quite slow - on my machine, 1 frame per second for 1024x1024 output. But in non-interactive mode, uncompressed 1024x1024 video was being output at around 22 fps. Encoding to some other codec would probably have slowed it down to 10 fps or so, similar to what ffmpeg was doing. 

ffmpeg's newly introduced v360 filter is supposed to do similar transformations, but it's not interactive.

Note: Paul adds in the comments below that there is a way to change the transformations over time with the v360 filter.

For testing v360 filter with ffmpeg, I had to download the static build for 24th March 2020, since even the latest release did not have this functionality.   

ffmpeg's output on the left, OCVWarp on the right. The default choices for interpolation seem to favour OCVWarp for better clarity. (Click on image for a bigger view.)




ffmpeg's output -



The ffmpeg commandline used was
./ffmpeg -i stock.webm -vf v360=e:fisheye:v_fov=180:h_fov=180:yaw=-90:w=1024:h=1024 outputfovsc-90.mp4
and a nice ffmpeg tutorial is available here.

And here is a link to all my posts about OCVWarp.

Edit on 2nd April - New release, with option to change output codec.

4 comments:

  1. Your results are simply invalid, nowhere in your output files can be found that v360 default results are worse than of another tool.

    ReplyDelete
    Replies
    1. Thank you. So, ffmpeg with v360 filter is a good option for converting files with fixed values for yaw, pitch etc. Do you know if there is some way to make it interactive like OCVWarp? If so, I will add that to the post.

      Delete
  2. Scroll to end of section of http://ffmpeg.org/ffmpeg-filters.html#v360 where commands is, it explain which options can be set interactively via commands, changing it realtime is slow like in your case, i work on vulkan version of filter which would not have such issue.

    ReplyDelete