I had the idea to build a photobooth for my cousin’s wedding, which shouldn’t be too hard to do. I already knew libgphoto2 which can be used to control a DSLR via USB. My Canon EOS 600D is compatible and supports the Live view feature, which I wanted to use. My initial plan was using a Raspberry Pi (and the DSLR connected to it) with Flask displaying the live view on the webpage and controlling it from there. After reading a little bit about displaying the live preview on a website I came to the conclusion that I am way too lazy to try and get that working. My next and final plan was writing everything in C++ using Qt, there is a working integration of libgphoto2 into Qt Multimedia which I was planning to use. The taken pictures should then be uploaded to a web app where the wedding guests would be able to download the full resoultion picture.
When using qtmultimedia-gphoto displaying the preview is as simple as this:
After having that little demo up and running I realized that the default Raspbian would not work out for me, because Qt kept having an issue with OpenGL and after displaying the live view for a few seconds weird graphic artifacts were showing up. So the next step for me was solving these issues that Qt had. After doing some reasearch I came across a tutorial that described how to build a Yocto embedded linux for the Raspberry Pi (including Qt). I followed this tutorial and got a working OS on my Raspberry Pi which did no longer have any issues with OpenGL. After confirming everything worked I actually adapted the bitbake image to only contain the stuff I needed:
Now if I wasn’t lazy and would need this more often I would create recipes for both qtmultimedia-gphoto and my own Photobooth app, but as compiling both on a Raspberry Pi 3 only takes a few seconds each I was not going to look deeper into that.
The only things still missing is the web app and the upload of the pictures taken. Once I am done with that I will write another post about it and publish the web app on Github too.