Stereoscopic video camera

After I had turned my antique stereoscope into a 3D animated GIF viewer, I began looking for ways to create my own 3D footage, preferably not limited to animated GIFs. I ended up building a stereoscopic camera from two ESP32 Camera boards. It records 3D videos (or stereoscopic pictures) on SD cards in a format that can be (dis)played by the stereoscope’s two TTGO T4 boards. The viewer can download recordings from the cameras over WiFi.

DIY stereoscopic (3D) video & photo camera with two ESP32-CAM boards

Building a prototype was quite simple because I could use code and techniques from my previous projects. Experiments with a TTGO T-Camera Plus board showed that 176×144 px frames (FRAMESIZE_QCIF) could be written to the on-board (SPI) SD slot at about 8 fps. This looked like the maximum size for this board, basically limited by its SD write speed. But then I realized that AI Thinker ESP32-CAM boards have a faster SD_MMC SD slot…

Over the SD_MMC bus in 4-bit mode* (about 2x faster than SPI), ESP32-CAM boards can write 240×176 frames (HQVGA) to the SD card at an acceptable frame rate > 9 fps. My benchmark tests showed that the (more consistent) 1-bit mode is only slightly slower. Moreover, this mode lets you control the flashlight via GPIO 4.

The exposed GPIO pins of ESP32-CAM boards can be used for synchronizing the frame shots taken by both cameras, using the technique that I had developed for the 3D viewer.

Fritzing schematic: the cross-wired Rx and Tx pins are used for frame synchronization

When it comes to reading recorded frames from SD card, the TTGO T4 boards in the viewer can easily achieve higher frame rates than the cameras, so in order to play my own recordings in real time, I had to include short delays after each frame.

So for now, my viewer shows 3D movies in 240×176 format (maximum duration is determined by the SD card’s free space), while pictures are displayed full screen.

 

*A well known consequence of accessing the SD slot of ESP32-CAM modules in 4-bit mode is that the flashlight will flash during SD transactions, as it is hard-wired to SD_MMC pin 4. That’s why I prefer the only slightly slower 1-bit mode, which is still considerably faster than SPI.