back

v360 ball 3 - animate yaw and pitch, little planet



dacapo.jpg
Equirectangular input, the garden of University Dacapo Mariestad, Sweden (http://www.dacapomariestad.se), 2002.

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

First set of 180 images:
#!/bin/bash
pitch=-90
yaw=-180# degrees, range -180 to 180, start from -180.
frame=1# start from 1, number of images.
while [ $frame -lt 181 ]# (-lt = less than) loop from 0 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

Second set of 180 images:
#!/bin/bash
pitch=90
yaw=0
frame=1
&while [ $frame -lt 181 ]
do
ffmpeg -i input.tif -hide_banner -vf v360=input=e:output=e:pitch="$pitch":yaw="$yaw" c/"$frame".jpg
pitch=$((pitch - 1))
yaw=$((yaw + 1))
frame=$((frame + 1))
done

Add 00 to image 1-9 of the first set, add 0 to 10-99 for the next step (use a file renamer, on Mac I use NameChanger: https://mrrsoftware.com/namechanger/)
Change file numbers of the second set, to 181-360, add them to the first set.

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

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 dacapo_yawpitch.mov

ffmpeg -i dacapo_yaw_pitch.mov -hide_banner -pix_fmt yuv420p dacapo_pan.mp4

"interp=cubic" Note: more complex interpolation methods require much more memory to run. Default value is 'line'.



dacapo_pan.mp4
panning movie, from the dacapo_yawpitch.mov

And to make the ball format with alpha mask use:

ffmpeg -i dacapo_yawpitch.mov -hide_banner -vf "v360=input=e:output=ball:interp=cubic:w=2048:h=2048:alpha_mask=1" -c:v prores_ks -profile:v 4444 -alpha_bits 8 -bits_per_mb 8000 -pix_fmt yuva444p10le dacapo_ball_yaw_pitch_4444.mov

If I make a straight .mp4, the background flickers, so to composit it on a black background I first make the background:
ffmpeg -f lavfi -i "color=0x000000:s=1920x1920" -r 30 -c:v libx264 -t 12 -pix_fmt yuv420p d/black1920.mov

And then composite them together:
ffmpeg -i black2048.mov -i dacapo_yaw_pitch_proRes4444.mov -hide_banner -filter_complex "overlay=x=W=2048:y=H=2048:x=w=2048:y=h=2048:x=0:y=0" -pix_fmt yuv420p -color_primaries bt709 -colorspace bt709 -color_range tv -color_trc 709 -movflags +faststart -preset slow -crf 18 dacapo_ball.mp4



Output "dacapo_ball.mp4", 12s at 30fps.
pitch=90 places zenith in the center (rotates CW), pitch=-90 places nadir in the center (rotates CCW).


	pitch=
	 90  68  45
	 22   0 -22
	-45 -68 -90 
Don't these look like little planet panos?

Perhaps make a version of "little planet",
ffmpeg -i dacapo_yaw_pitch_proRes422.mov -vf v360=input=equirect:output=fisheye:h_fov=360:v_fov=360 -y lplanet01.mov
fisheye, h_fov=360, v_fov=360 [max value 360]
Thanks Michael Koch, "2.120 Remap an equirectangular video to a "Little planet" video" see info



dacapo_lplanet05.mp4

If I change the little planet script to "fisheye:h_fov=300:v_fov=300" it gets close to the "ball" format except at the edges.

back