Friday, October 06, 2023

converting youtube 360 VR webm files to equirectangular

Earlier, I had downloaded some youtube 360 VR files, which were in equirectangular format, converted to either fulldome or pre-warped mirrordome using OCVWarp, and projected on our dome. For example

360° Video of Vidhan Soudha, Bengaluru During On Going Lock-Down  

But (recently?) when I tried out 360 VR 4K videos like this one

Tim Peake ISS 360° Planetarium Tour

the format was different - not equirectangular. While I thought about exploring the format to find out some workaround, found that Paul Bourke has already done it in Jan 2020.

YouTube 360 video format

Apparently it's 6 faces of the conventional cube map, but resized a bit. Ordered as left-front-right
bottom-back-top

And he mentions the ffmpeg command to convert it to equirectangular, which I tested and seemed to work,

ffmpeg \
-y \
-hide_banner \
-i input.mkv \
-vf "v360=c3x2:e:cubic:in_forder='lfrdbu':in_frot='000313',scale=3840:1920,setsar=1:1" \
-pix_fmt yuv420p -c:v libx264 -preset faster -crf 21 \
-c:a copy -ss 16 -t 10 -movflags +faststart \
output.mp4





No comments:

Post a Comment