I've been looking for a library so that I can take pictures on the pi using the pi camera (not a usb webcam). I've tried RaspiCam but that is having issues compiling in visual studio 2015 (yes i'm not developing on the pi itself).

Is there another library that allows images to be taken from the pi camera?

  • 1
    What operating system are you running on the Pi? Windows IoT doesn't support the Pi camera in any way.
    – goobering
    Commented Sep 18, 2016 at 17:18
  • I'm developing on Windows 10 then running in on raspian Commented Sep 18, 2016 at 22:04
  • That's not going to work, visual studio can't do that. Commented Sep 18, 2016 at 22:58
  • Actually, it might, but I don't fancy trying it. Looks complicated! It'll be slower, but you'll probably have better results shifting your source files over to the Pi and compiling it there.
    – goobering
    Commented Sep 18, 2016 at 23:10
  • Why wouldn't it work? So far all the code that I've written has worked with it, this being a bit more fussy than the other stuff... Commented Sep 19, 2016 at 5:03

2 Answers 2


The usual way to use the camera from C/C++ is to use libmmal (this is the library used by raspistill and raspivid). The source is part of the userland repository, specifically look under interface/mmal in there and you'll find all the headers.

For examples of MMAL use, have a look at the raspistill and raspivid source code, which you can find under host_applications/linux/apps/raspicam in the same repository. Whether this will compile under Visual Studio I don't know (from goobering's link it looks like it's using GCC, so there's a chance).

  • Cool, I'll look into this and see what happens and report back in a week or so :) Commented Sep 20, 2016 at 19:57
  • Ok, I tried to get this going but there were quite a lot of errors when i tried to make it work with Visual Studio. I ended up using the Python camera version and then just stated a python engine and called the python methods from that in C#. I might look back into this at some point just to see if it can be done... Commented Oct 11, 2016 at 18:05

An alternative is to use gstreamer with Raspicam. I only used gstreamer with Pi Zero streaming from cheap USB webcam to LCD (see details). It has a huge number of plugins you can just use. And you can write your own plugins (I have not done that yet, GStreamer Plugin Writer's Guide, gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/). see details


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.