I remembered recently my work with I2C command injection in raspivid (I know there is a risk, but normally it works) resulting in every other frame with different shutter speeds:
Yesterday I thought whether it would be possible to do stereoscopic camera capture with single v2 camera using the same I2C command injection trick.
After I added "--lft" option for setting left border for v2 camera to raspivid in my userland fork, I added experimental "--lft3D" option, and it seens to work:
https://github.com/Hermann-SW/userland/ ... 91609eeb03
I did record with mode 7 (640x480) and that has 2x2 binning. That means that "normal" raspivid horizontal view is [1000..2279] from 3280 pixels in total.. "--lft3D X" results in odd frame range [1000-X..2279-X] and even frame range [1000+X..2279+X].
This is sample command execution and frame skip analysis (no skips):
Code: Select all
pi@raspberrypi3BplusX:~ $ raspivid -md 7 -w 640 -h 480 -t 15000 -stf 5 -l3D 500 -o tst.h264 -pts x.pts pi@raspberrypi3BplusX:~ $ ptsanalyze x.pts 5 creating tstamps.csv 592 frames were captured at 40fps frame delta time[us] distribution 6 24867 375 24868 208 24869 after skip frame indices (middle column) 0 frame skips (0%) pi@raspberrypi3BplusX:~ $
Running with framerate 50fps results in "mmal: Failed to write register 0x0164" error messages of new code. But this is not high framerate work, and 40fps means that left and right eye get recorded at 20fps each, not that bad. I did upload the unprocessed .h264 video taken by above command to youtube:
https://www.youtube.com/watch?v=bWs0H-J ... e=youtu.be
Colors look OK, and even moving the Arduino Due around seems to result in fine video frames captured.
I have no idea what "--lft3D" values to use, values between 0 and 1000 are possible (video was taken with 500).
You can stop youtube video and single-step fore/backward with "."/"," keys to remove the high flicker.
This is an odd numbered frame (left eye):
And this is the next frame (right eye):
- post processing tool to separate left/right frames
- alternatively let raspivid write two .h264 output files in case of "--lft3D" option
- post processing to combine the left/right videos to 3D video (1280x480)
- experiment which "--lft3D" arguments result in "good" 3D view
Manually copied together, flat CD sleeve in middle of image on monitor and nose at CD sleeve allows first impression: