I'm using a pi distro that includes the proper kernel and everything, but not
raspicam. How can I install these?
raspivid. How can I install these?
They're distributed pre-compiled (armv6, which will work with any distro that runs on any model) via the Raspberry Pi Foundation's github site, in the same repository that includes the kernel and various other bits.
git clone https://github.com/raspberrypi/firmware
You don't need to install this on the Pi, as long as it is possible for you to copy some files back and forth. I mention this because my current version of it is 8.1 GB -- however, I've been updating (various branches of) it for years and 7.9 GB of that are in the
.git directory, so a fresh download should be much smaller.
For the raspicam stuff, you only need what's in the
hardfp/opt/vc/ directory. Beware there's also an
readelf seems to confirm that, as implied, these are not compiled with hardware floating point support (which is likely significant for graphics applications, although most of the heavy lifting should be done on the GPU anyway).
You can copy all that straight into the top level of you root file system as
/opt/vc on the Pi. You then need to let the dynamic linker know about the libraries:
echo "/opt/vc/lib" > opt-vc.conf sudo chown root.root opt-vc.conf sudo mv opt-vc.conf /etc/ld.so.conf.d/ sudo ldconfig
You should now be able to go into
/opt/vc/bin and run
ldd raspistill to check it is linked properly:
> ldd /opt/vc/bin/raspistill linux-vdso.so.1 (0x7efff000) libmmal_core.so => /opt/vc/lib/libmmal_core.so (0x76f0b000) libmmal_util.so => /opt/vc/lib/libmmal_util.so (0x76eeb000) libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0x76ed0000) libbrcmGLESv2.so => /opt/vc/lib/libbrcmGLESv2.so (0x76eab000) libbrcmEGL.so => /opt/vc/lib/libbrcmEGL.so (0x76e72000) libm.so.6 => /lib/libm.so.6 (0x76df0000) libvcsm.so => /opt/vc/lib/libvcsm.so (0x76ddc000) libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x76db6000) libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x76da0000) libvcos.so => /opt/vc/lib/libvcos.so (0x76d84000) libpthread.so.0 => /lib/libpthread.so.0 (0x76d5b000) libdl.so.2 => /lib/libdl.so.2 (0x76d46000) librt.so.1 => /lib/librt.so.1 (0x76d2f000) libc.so.6 => /lib/libc.so.6 (0x76bcf000) /lib/ld-linux-armhf.so.3 (0x54b7a000)
By "properly linked", I just mean check there's no
??? after any of the
=> arrows. The output will differ a bit from system to system except for the pi-specific
You probably then want to add that
bin directory (which includes
vcgencmd and some other things) to your
$PATH, so that the executables (such as
raspistill) can be found.
If you are going to compile against the libraries note there's a
pkgconfig directory and you may want to add that to your
$PKG_CONFIG_PATH. The Pi version of OpenGL-ES is in there (notice some of it is linked to
Note that you still have to enable the camera, which is a matter of adding
/boot/config.txt and explicitly committing at least 128 MB of RAM to the GPU.