This example shows one of the ways you can stream live video feed from your DSLR camera. It simply reads MJPEG output by gPhoto2 frame-by-frame, parses it, and put up the frame buffer on the screen window.
You should be able to easily change the graphical system to use something else (e.g. GLFW, Qt, openFrameworks, etc..)
- GCC
- gPhoto2
- SDL2
- SDL2_image
- DSLR Camera
All those packages should be available through your Linux or OSX package managers.
- Plug in a USB connector from your camera to your computer
- (optional) Change WINDOW_WIDTH and WINDOW_HEIGHT as needed (if your camera outputs high-resolution videos)
- Run
make
1a. To grab frames directly from camera, run gphoto2 --capture-movie --stdout | ./gphoto2-liveview-example
1b. To use existing MJPEG recording, run ./gphoto2-liveview-example [MJPEG filename]