yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
USB Microphone Camera📖
1.About Camera
  • About Camera
2.For Raspberry Pi
  • 1.1 Camera test tutorial
  • 1.2 Camera webpage access tutorial
  • 1.3 Camera python driver tutorial
3.For Jetson NANO
  • 2.1 USB camera test tutorial
  • 2.2 Camera python driver tutorial
4.For RDK X3
  • Drive tutorials
Download ZIP

Welcome to USB Microphone Camera repository

1.2 Camera webpage access tutorial


Part 1--Connect camera into Raspberry Pi board

1. User must ensure that the camera is properly inserted into the Raspberry Pi board before supplying power to the Raspberry Pi board.

2. There are two kinds of commands that the Raspberry Pi terminal can use to detect external camera devices: "lsusb" and "ls/dev/video*". (In some cases, you may be able to use the camera without seeing video0 service)

After we input following command, we can detect camera service.

As shown below.

image.png 

 

Part 2 -- Upgrading the system

You must to install a new operating  system before use camera, which can  can identify if the camera module is connected. The simplest method is download Raspbain system from Raspberry Pi website, and install it to new SD card.

 

Regardless of the version of the Raspbian system you are using, I recommend that you update the system with the following command:

sudo apt-get update

sudo apt-get upgrade

 

Part 3 -- Open the camera service of Raspberry Pi

1. If you use Raspberry Pi official system image, you need to open the camera service. Input sudo raspi-config command to enter following interface.

2. Choose fifth option [Interfacing Options] and click [Enter] key to enter next interface.

image.png 

3. ChoOse [Camera] to enable camera.

image.png 

4. Finally, we need to reboot Raspberry Pi.

Input sudo reboot command.

 

Part 4 -- Using camera

1.You can transfer the video which captured by the Raspberry Pi to the web page.

You need to log in to the WinSCP software and transfer the master.zip file to the pi directory of the Raspberry Pi.image.png 

2.You should input: #unzip master.zip

(This command to unzip mater.zip)

After complete unzip, input ls, you can see migp-streamer-master folder. As shown in the figure below.

image.png 

 

3.Compiling this project requires cmake: perform the following command to install download.

(apt-get is a networked installation, so you need make Raspberry Pi successfully connect to the network.)

 

You should input:

#sudo apt-get install cmake  

A prompt will appear when installing, you need to enter Y.

After completion, As shown in the figure below.

image.png

4. You need to install library

You should input:

#sudo apt-get install libjpeg8-dev  

After completion, As shown in the figure below.

image.png

 

5.Compiling

Note: we possess two formats of camera (JPEG/YUYV )

2-degree-of-freedom camera: YUYV/JPEG

If we want to change to the YUYV format, we need to modify the relevant files and compile:

Specific steps as shown below:

You should enter the input_uvc.c file in the /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/plugins/input_uvc/ directory.

 

You should input:

cd /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/plugins/input_uvc/

You should input:

 ls

image.png 

 

Just modify the format of 135 lines to V4L2_PIX_FMT_YUYV (The default is format=V4L2_PIX_FMT_MJPEG)

You should input command

nano -c input_uvc.c

image.png 

If you want to change the resolution and frame rate of the USB camera, you can change it here.

After the modification is completed, press ctrl+X, press Y to save, and then press the Enter key.

Then return to the mjpg-streamer-experimental folder to compile

Then return to mjpg-streamer-experimental:

cd /home/pi/mjpg-streamer-master/mjpg-streamer-experimental

 

And input make clean all to complete the compilation.

image.png 

You can wait for the compilation to complete, you can see the interface shown below.

image.png 

6.Restart system

You need to input: sudo reboot  to reboot system

Plug in the camera and restart the system.

 

7. After rebooting, enter the system.

You need to  enter the mjpg-streamer-experimental directory by command. And use the following command to start the normal USB camera (for 2-DOF cameras):

#./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"  

 

Some cameras will report an error when executing this command. If they do not return to the command prompt and display "Starting Camera", it means success.

As shown in the figure below, the camera is successfully turned on:

image.png 

8. Testing

View the image, open the browser on the PC side, you need to enter the following URL to see the static screenshot:

http://<RaspberryPi IP>:8080/?action=snapshot  

My URL is:http://192.168.0.179:8080/?action=snapshot  

As shown below.

image.png 

 

You should input the following URL to see the dynamic image:

http://<RaspberryPi IP>:8080/javascript_simple.html  

My URL is:http://192.168.1.179:8080/javascript_simple.html

image.png 

Note: After running the camera web page service, this process will occupy the camera, causing other camera commands to fail to run. Please end the process before running other camera commands.

View camera process number:

ps a

image.png 

Input following command to kill PID

sudo kill -9 1118

image.png 

Different Raspberry Pi process numbers are different. Please refer to the process shown in your own system.



Camera test tutorial
Camera python driver tutorial

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文