Page 1 of 1

Splitting stereo video into two videos?

Posted: Thu May 12, 2022 8:58 pm
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?

Re: Splitting stereo video into two videos?

Posted: Fri May 13, 2022 4:56 am
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)

Re: Splitting stereo video into two videos?

Posted: Fri May 13, 2022 7:16 am
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?

Re: Splitting stereo video into two videos?

Posted: Thu Jun 30, 2022 6:21 pm
by atrunyan
Hi Realizator,
I'm trying to create 3D models in agisoft from collected stereovideo, and I'm unsure if I can directly input stereo video into the software, or if I need to input frames from each camera. I am also looking into how to give it my calibration camera info to get accurately sized models.
Also, Id like to create depth maps from pre-recorded video, but am unsure how to do that and save the depth map video. I'm able to see depth maps with stills, but still unable to save the result.

Re: Splitting stereo video into two videos?

Posted: Fri Jul 01, 2022 12:22 pm
by Realizator
Hi atrunyan,
atrunyan wrote:
Thu Jun 30, 2022 6:21 pm
I am also looking into how to give it my calibration camera info to get accurately sized models.
- as I understand, you can use the built-in Agisoft calibration. I.e. just feed it up with calibration images, and it'll calibrate camera.

I'm not familiar with Agisoft, but brief search shows me a few topics related to the camera specs passing to the code (like this one). So I think you can either calibrate images inside Agisoft, or try to pass your calibnration data. I'd prefer the first way.

Also, AFAIK, photogrammetry usually rely on the sequence of frames from one camera (preferrably including the camera position/orientation data for each frame). But this is too specific topic, related to Agisoft.