8,367
edits
Changes
→USB Camera Test
# First, you need to prepare a USB camera that supports the UVC protocol in the figure below, and then insert the USB camera into the USB interface of the Orange PI development board
::[[File:pi3b-img13.png]]
<ol start="2" style="list-style-type: decimal;">
<li>You can see that the USB camera's device node information is/dev/video0 through the v4l2-ctl command</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''
Q8 HD Webcam: Q8 HD Webcam ('''<span style="color:#FF0000">usb</span>'''-fc880000.usb-1): '''/dev/video0'''
:'''<span style="color:blue">/dev/video1video0</span>'''
:/dev/media0video1
:/dev/media0|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that l in v4l2 is a lowercase letter l, not numbers 1.'''
'''In addition, Video's serial number is not necessarily Video0, please refer to what you see.'''</big>
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>In the desktop system, you can use Cheese to directly turn on the USB camera. The cheese opening method is shown in the figure below: </li></ol>
[[File:pi3b-img246.png]]
[[File:pi3b-img247.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>How to test the USB camera using fswebcam</p>
<ol style="list-style-type: lower-alpha;">
<li>Install fswebcam</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo''' '''apt update'''
orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>After installing fswebcam, you can use the following command to take pictures</p>
<li><p>-r The option is used to specify the resolution of the photo</p></li>
<li><p>-S The option is set to the number of frames before skipping</p></li>
<li><p>./image.jpg The name and path for setting the generated photos</p></li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''
'''--no-banner -r 1280x720 -S 5 ./image.jpg'''
|}</ol></li></ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>In the service version of the Linux system, you can use the scp command to pass the picture to the Ubuntu PC to watch after taking the photo</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''scp image.jpg''' [mailto:[email protected]:/home/test [email protected]:/home/test] '''(Modify the IP address and path according to the actual situation)'''
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>In the desktop version of the Linux system, you can directly view the shot pictures through the HDMI display</li></ol>
</li></ol>
<span id="audio-test"></span>