Splitting stereo video into two videos?

Raspberry Pi cameras (V1, V2, wide angle etc), HDMI capture modules etc.
Post Reply
Posts: 4
Joined: Fri Oct 22, 2021 4:36 pm

Splitting stereo video into two videos?

Post by atrunyan »

Hi, I'm hoping to be able to split my recorded split screen video into a left and right video so that I can make a disparity map video from them. Is this possible? How would I go about doing this?

Posts: 211
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Splitting stereo video into two videos?

Post by stereomaton »

For offline conversion (after the half-sbs file is created), here is a ffmpeg command to split your video input.mp4 into two files output_l.mp4 and output_r.mp4:

Code: Select all

ffmpeg -i input.mp4 -filter_complex 'split[a][b],[a]stereo3d=sbs2l:ml[l],[b]stereo3d=sbs2l:mr[r]' -map '[l]' output_l.mp4 -map '[r]' output_r.mp4
If you want to do it live, see https://github.com/realizator/stereopi-fisheye-robot (and in particular 6_dm_video.py for live disparity map after the calibration is done ; you can also find a code to split the frame in two images in this file if you are interested in this specific part only)
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

User avatar
Site Admin
Posts: 835
Joined: Tue Apr 16, 2019 9:23 am

Re: Splitting stereo video into two videos?

Post by Realizator »

Stereomaton, thank you for your answer!

atrunyan, I'm curious why do you need two independent video files to get the disparity map, but not the single side-by-side file. What's the aim of the project?
Eugene a.k.a. Realizator

Post Reply