back

I moved this and more pages on ffmpeg here

The idea is to make a 360° stereo panorama video (or timelapse) where there is movement in only one part. That's in one cubic face of the six cubic faces that makes the sphere stereo panorama. Using only PTGui and a late version of FFMpeg. Here with still image formats till the final movies.

An advancement would be to populate more cubic faces, up to all, but each separately.

There is a lack of open source stereo programs for Mac OS other than ffmpeg, please correct me.

When I upgrade my computer I would love to learn how to do this in Blackmagic Resolve Studio + KartaVR.

So this is more a proof of concept. Also to show that ffmpeg can be a tool in projects like this.



This is the area where I want to have movement.



And here is a b/w anaglyph cubic stereo face from my test.

Here is the test in flat anaglyph HD format, 9 sec at 2fps. Disregard stitching errors. You can see where the dancers gets cut off at the edge of the cubic face.

8 photos x 2, no zenith or nadir + 18 x 2 taken for the movement in one of the 8 camera positions.

Hardware: ( x 2 when needed )
Sony a 6300, APS-C, 1.5 half-frame.
Nikon AF-S Fisheye-Nikkor 10.5mm f/2.8G ED.
Metabones N/F-E Adapter Nikon G -> Sony E-mount.
Sony RM-VPR1 cables from Nodal Ninja (via Pano Society) with a home made release box - with a switch to allow camera settings to be adjusted when connected.
Cameras in portrait format, slightly toe-in, rotated on the left camera's no-parallax point. Old Manfrotto rotator. Smallrig and other Arca Swiss compatible parts.

Software:
(Lightroom 6.9)
PTGui Pro 12 beta 14, following the Zakato_stereo_webinar with Antonio Victor Garcia-Serrano: https://www.youtube.com/watch?v=bOoHpd9T_e4&feature=youtu.be
Next time I will try Thomas Sharples's multipatch technique.
FFMpeg 4.3.1, command-line tool
(Pano2VR6 6.1.10)
BBEdit 12.6.7 or other text editor
NameChanger or other file renamer
MacOS 10.13, on a very modest MacBook Air i5

It really helps (me) to rename/renumber the photos from the two cameras before combining them to stereo, or reset the numbering in the cameras.

In ffmpeg stereo, there is a frame size limit of ≈16000x16000 px over/under (or 32000x8000 side/side). I tried to work with 16384x16384 and it failed. Jpgs can give corrupt files, tif and png and many other picture and video formats works. – I'm learning ffmpeg as I go along – I found the "untile" filter when writing this.

Combining a panorama for the left eye and a panorama for the right eye to stereo:
ffmpeg hstack filter
ffmpeg vstack filter
ffmpeg -i left_eye.tif -i right_eye.tif -filter_complex "vstack" above_below.tif

ffmpeg -i left_eye.tif -i right_eye.tif -filter_complex "hstack" side_by_side.tif

To desaturate the stereo panorama:
ffmpeg hue filter
ffmpeg -i stereo.tif -vf "hue=s=0" stereo_black_white.tif

And to make the anaglyph:
ffmpeg stereo3d filter
ffmpeg -i above_below.tif -vf "stereo3d=abl:arcd" abl_anaglyph.tif

ffmpeg -i side_by_side.tif -vf "stereo3d=sbsl:arcd" sbsl_anaglyph.tif

The new filter "v360" converts 360 videos/images between various formats. Here I'm converting an equirectangular panorama to a cubemap in 6x1 format (horisontal).
ffmpeg v360 filter
v360 filter, cubemap face names: right 'r', left 'l', up 'u', down 'd', forward 'f', back 'b'. Default value is 'rludfb'. To get the forward cubemap face first or last in the cubemap, set order thus:
ffmpeg -i anaglyph.tif -vf 'v360=input=e:output=c6x1:out_forder=fbrlud' cubemap_fbrlud.tif

ffmpeg -i anaglyph.tif -vf 'v360=input=e:output=c6x1:out_forder=brludf' cubemap_brludf.tif

I've added a set of 6 small (240x240 px) cubic faces to play with - if you have ffmpeg installed and have not used the v360 filter, also a text file with a few commands: zipped faces



Example, forward cube face: 5.

Untile the cubemap to it's six faces:
ffmpeg untile filter
ffmpeg -i folder/cubmap.tif -vf untile=6x1 folder/%d.tif
or keep the "brlud" part of the cubemap intact, with cubemaps of 12000x2000 px:
ffmpeg -i cubemap_brludf.tif -vf "crop=10000:2000:0:0" cubemap_brlud.tif
To extract the forward cube faces, with cubemaps of 12000x2000 px. (Or use the untile filter.)
ffmpeg crop filter
ffmpeg -i cubemap.tif -vf "crop=2000:2000:8000:0" face05f.tif

Reassembly of the cubemaps (Pano2VR is faster if you have it).
ffmpeg tile filter
v360 filter names cubemap faces: 'r' right, 'l' left, 'u' up, 'd' down, 'f' forward, 'b' back. Default value is 'rludfb'. Extract each cubemap and rename right to 1.tif, left to 2.tif etc. Then reassemble them with only forward 5 being changed.
ffmpeg -i folder/%d.tif -filter_complex 'tile=6x1' folder/cubemap01.tif

Alternatively use Pano2VR6 to reassemble the equirectangular panorama. Though when I add the cube face files, I get a message File "can't be opened!, but it works anyway. Pano2VR5 works too - without error message. And make the final equirectangular files.

Ffmpeg's v360 filter can convert the cubemaps back to equirectangular after reassembly:
ffmpeg -i cubemap01.tif -vf v360=c6x1:e equirectangular01.png
I notice that the forward cube face gets placed in the center of the equirectangular file.
To offset the forward cube face to the left of the equirectangular file, in degrees:
ffmpeg -i equirectangular01.png -vf 'v360=input=e:output=e:yaw=90' equirectangular01_90.png
yaw offset pixels from one side to the other, like offset filter with horizontal wrap around in PhotoShop.

From the 18 equirectangular pngs, (renamed if necessary) as a sequence of 01.png to 18.png, I wanted a movie:
ffmpeg -framerate 2 -i directory/%02d.png -vf format=yuv420p -c:v libx264 -preset slow -crf 18 directory/studio0202d.mp4

The movie was 6000x3000 px and I wanted it smaller and in hd format for this page:
ffmpeg -framerate 2 -i folder/%02d.png -vf "scale=hd1080" format=yuv420p -c:v libx264 -preset slow -crf 18 folder/studio0202d1.mp4
Which you see above.

Conclusion, much to test and learn. For coming tests, can I trigger the start of 4K video on both Sony cameras simultaneously, via USB? I need to learn better how to batch ffmpeg, any help to learn bash? I'm retired, and getting slow, forgetting is starting to catch up with learning.

my very similar: "ffmpeg for mono VRs"

I find this free ffmpeg course to be valuable: ffmpeg-encoding-course



The rig is not optimal when changing memory cards or batteries. But to shoot video they should be positioned side by side like here (not one vertically flipped) or the rolling shutter will give problems, fast movement across the frame in normal horisontal video is bad enough.

back