back

v360 stereographic (little planet) projection:
animate yaw and pitch

The v360 filter has many projection formats, here the "stereographic" format.
To show what to work with, I make a grid of different pitch values in stereographic format.
ffmpeg -i dacapo.jpg -vf "v360=input=e:output=sg:h_fov=300:v_fov=300:pitch=90:w=1280:h=1280" sg/01.jpg

h_fov=300:v_fov=300:, decides zoom, value 0-360.

And I repeat 8 times, changing pitch=90 to 68, 45, 22, 0, -22, -45, -68, -90, to get a visualisation of the filter.
ffmpeg -i sg/%02d.jpg -vf "tile=3x3,scale=1280x1280" sg9.jpg

 pitch=
	 90  68  45
	 22   0 -22
	-45 -68 -90 


sg9.jpg

I'm reusing the dacapo equirectangular from "reassemble a QTVR pano". To make a flat video in stereographic format from an equirectangular file, I first make 180 equirectangular images with 1° horizontal increase*. Starting from the left, pitch position -90 to 90 (the pitch range in v360) and yaw -180 to 0.

* to increase the number of frames, I have to leave bash as it only accepts integers. I would use Black Magic Design's Fusion Studio with Reactor to directly make an intermediate movie in any length. I extend the length five times in the example at the bottom of this page.

To make the batch, use bash or zsh as follows:

Make 180 images:
#!/bin/bash
pitch=-90# degrees, range -90 to 90.
yaw=-180# degrees, range -180 to 180, here only to 0.
frame=1# start from 1, number of images.
while [ $frame -lt 181 ]# (-lt = less than) loop from 1 to 180 frames, then stop.
do
ffmpeg -i input.jpg -hide_banner -vf v360=input=e:output=e:pitch="$pitch":yaw="$yaw" b/"$frame".jpg
pitch=$((pitch + 1))
yaw=$((yaw + 1))# increase yaw by one (integer).
frame=$((frame + 1))# increase image number.
done

Add 00 to image 1-9, add 0 to 10-99 for the next step (use a file renamer, on Mac I use NameChanger: https://mrrsoftware.com/namechanger/).

Make a high quality intermediate movie from the jpeg files in .mov or .mkv format:
(and with that movie you can make more experiments.

ffmpeg -r 30 -i b/%03d.jpg -c:v prores_ks -profile:v 3 -vendor apl0 -bits_per_mb 8000 -r 30 -pix_fmt yuv422p10le -180-90t0t90_180.mov

And to present the panning/pitching video here:
ffmpeg -i -180-90t0t90_180.mov -hide_banner -vf "v360=input=e:output=sg:h_fov=300:v_fov=300:w=2048:h=2048" -pix_fmt yuv420p -color_primaries bt709 -colorspace bt709 -color_range tv -color_trc 709 -movflags +faststart -preset slow -crf 24 -y dacapo-180-90t0t90pan_180.mp4



dacapo-180-90t0t90pan_180.mp4
Panning movie, from the -180-90t0t90_180.mov

paulbourke - littleplanet, see the stereographic projection diagram and Extreme Fisheye Projections, and wikipedia Stereographic_projection.

And for panoramic photographers who have Pano2VR, Tony Redhead has a tutorial on:
Adding a “Fly-in” to a Node in stereographic format.

And here it's in stereographic (little planet) format:
ffmpeg -i -180-90t0t90_180.mov -hide_banner -vf "v360=input=e:output=sg:h_fov=300:v_fov=300:w=2048:h=2048" -pix_fmt yuv420p -color_primaries bt709 -colorspace bt709 -color_range tv -color_trc 709 -movflags +faststart -preset slow -crf 24 -y sg-180-90t0t90_180.mp4



sg-180-90t0t90_180.mp4, bash-ffmpeg, 6 sec.
	roll    X      0       0
	yaw     Y   -180  to   0
	pitch   Z    -90  to  90


lplanet03.mp4, fusion-ffmpeg, 30 sec.
	roll    X      0       0
	yaw     Y   -180  to   0
	pitch   Z    -90  to  90
Extended to 900 frames in Black Magic Design's Fusion Studio with Reactor.

back