Hardware:
OSOYOO Web Camera Module for Raspberry Pi
Pi Board: Raspberry Pi 4 (with CSI cable) or Pi 5
Software Installation:
Preinstalled OS: Raspberry Pi Bookworm or Raspberry Pi Bulleye
1)Install utream server
If you are using Bookworm OS, Please run following commands:
sudo apt install libevent-dev libbsd-dev libcamera-v4l2 sudo apt-get install libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev build-essential g++
wget https://osoyoo.com/driver/v5car/ustreamer.tar.gz
wget https://osoyoo.com/driver/v5car/utbegin.sh
tar -zxvf ustreamer.tar.gz
cd ustreamer make
If you feel above commands are too complicated, don’t worry, we have put these commands into a shell script file, you can simply run following commands to install ustream
wget https://osoyoo.com/driver/v5car/ut-bookworm.sh
bash ut-bookworm.sh
If you are using Bulleye OS, please run following command:
wget https://osoyoo.com/driver/v5car/ut-bulleye.sh
bash ut-bulleye.sh
2)Start the server
To start the webcam server, please run following command:
libcamerify ./ustreamer --host 0.0.0.0 --port=8899 --device=/dev/video0 -m yuyv --encoder=m2m-video --device-timeout=5 --buffers=3 --resolution=1280x720 --desired-fps=20
If you feel above command is too long, you can simply run
bash utbegin.sh
Once you started the ustreamer server, you can use your web browser to visit :
http://your_raspberry_pi_ip_address:8899 to see the web camera
If you don’t know your_raspberry_pi_ip_address, please type following command in Raspberry Pi terminal:
hostname -I
For example, if your hostname -I command shows:
192.168.1.19 2604:3d08:507c:c800::639d 2604:3d08:507c:c800:4310:a8e3:a8fc:a5e2
it means your Pi IP is 192.168.1.19, so you can use
http://192.168.1.19:8899 to see your web camera video stream
DownLoad Url osoyoo.com
You must be logged in to post a comment.
I have struggled to get a USB webcam installed on my raspberry Pi 4 running bookworm. This process was able to get the video working. However, it seems to flash every several seconds.
[0:45:25.399368106] [22527] INFO Camera camera.cpp:1183 configuring streams: (0) 720×576-YUYV
— INFO [2725.401 ] — CAP: Using resolution: 720×576
— INFO [2725.401 ] — CAP: Using format: YUYV
— INFO [2725.401 ] — CAP: Querying HW FPS changing is not supported
— INFO [2725.401 ] — CAP: Using IO method: MMAP
[0:45:25.403963643] [22527] INFO Camera camera.cpp:1183 configuring streams: (0) 720×576-YUYV
— INFO [2725.408 ] — CAP: Requested 3 device buffers, got 4
— INFO [2725.412 ] — CAP: Capturing started
— INFO [2725.412 ] — Using JPEG quality: 80%
— INFO [2725.412 ] — Creating pool JPEG with 4 workers …
— INFO [2725.414 ] — Capturing …
[0:45:25.464657575] [4113] INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video0[15:cap]: Zero sequence expected for first frame (got 1)
[0:45:25.584901600] [22527] ERROR V4L2Compat v4l2_camera_proxy.cpp:680 Failed to clear eventfd POLLIN
[0:45:25.585200393] [22527] ERROR V4L2Compat v4l2_camera_proxy.cpp:680 Failed to clear eventfd POLLIN
[0:45:25.585351706] [22527] ERROR Request request.cpp:472 FrameBuffer already set for stream
[0:45:25.585430798] [22527] ERROR V4L2Compat v4l2_camera.cpp:259 Can’t set buffer for request
— ERROR [2725.585 ] — CAP: Can’t release HW buffer=0 (skipped frame): Cannot allocate memory
— INFO [2725.614 ] — Destroying workers pool JPEG …
— INFO [2725.619 ] — CAP: Capturing stopped
Running bookwork OS in Pi 4 might not be quite stable. We suggest you install legacy Bulleye OS Pi 4 and read instruction here:
https://osoyoo.com/2023/03/30/osoyoo-raspberry-pi-v2-0-car-lesson-6-web-camera-controlled-iot-raspberry-pi-robot-car/
If you don’t where to download Legacy BullEye OS, here is the download link:
https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-legacy
Thanks
OSOYOO Support