Skip to content

Latest commit

 

History

History
71 lines (63 loc) · 1.81 KB

README.md

File metadata and controls

71 lines (63 loc) · 1.81 KB

PiCam

How to run

Make sure you have data directory next to pi_cam executable!

./pi_cam

Some useful args

  • --port [-p] specifies port
  • --height [-h] specifies desired camera frame height
  • --width [-w] specifies desired camera frame width
  • --blur [-b] blurs background
  • --grayscale [-g] grayscale background

Example:

./picam --port 8090 --height 480 --width 720 -b -g 

How to fake webcam

_See: https://sn

apcraft.io/fakecam_

sudo apt-get install v4l2loopback-dkms
 echo options v4l2loopback devices=1 video_nr=20 \
 card_label="fakecam" exclusive_caps=1 | sudo tee -a \
 /etc/modprobe.d/fakecam.conf
 echo v4l2loopback | sudo tee -a /etc/modules-load.d/fakecam.conf
 sudo modprobe -r v4l2loopback
 sudo modprobe v4l2loopback

Then run

ffmpeg -re -i http://picam.local:8080 -map 0:v -vf format=yuv420p -f v4l2 /dev/video20

How to build

Clone

git clone https://github.com/kilpkonn/PiCam.git && cd PiCam

Build OpenCV binaries or development

./script/install-opencv.sh

Build armhf binaries

sudo bash ./script build-in-docker.sh

Copy build armhf binaries to Raspberry

scp -r build-armhf [email protected]:~/

Run install script on Raspberry

ssh [email protected]
sudo bash ~/build/pi-setup.sh

Note that you might have to enable Raspberry's cam as well using raspi-config

Cleanup after reboot

sudo rm -rf ~/build

OpenCV installation

See this tutorial.
Another great tutorial for cross compiling can be found here.