本文適用與觸覺智能所有RK356X ubuntu系統的主板。
IDO-SBC3566基于瑞芯微RK3566研發的一款高性能低功耗的智能主板,采用四核A55,主頻高達1.8GHz,專為個人移動互聯網設備和AIOT設備而設計,內置了多種功能強大的嵌入式硬件引擎,為高端應用提供了優異的性能,支持幾乎全格式的4K編解碼,內置3DGPU,能夠完全兼容OpenGL ES1.1/2.0/3.2、OpenCL2.0和Vulkan1.0.特殊的MMU2D硬件引擎,此外,憑借其強大的兼容性,可以輕松地轉換基于TensorFlow/MXNet/PyTorch/Caffe等一系列框架的網絡模型。
支持Android,Linux,OpenHarmony,麒麟OS等多種操作系統,可廣泛應用于平板、教育平板、帶屏音箱、詞典筆、云終端、視頻會議系統等安卓/Linux類應用方案,以及其他帶屏消費類、或輕量級AI應用場景。
01確認USB攝像頭設備節點主板接上USB攝像頭后,使用以下命令查看USB攝像頭的設備節點:
root@ido:~# v4l2-ctl --list-devices
rkisp-statistics (platform:rkisp):
/dev/video7
/dev/video8
rkisp_mainpath (platform:rkisp-vir0):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/video6
/dev/media0
AC_2019053011080005:ZH-0305(usb-xhci-hcd.4.auto-1):
/dev/video9
/dev/video10
/dev/media1
video9即為USB攝像頭的設備節點。02查看USB攝像頭支持的圖像格式
root@ido:~# v4l2-ctl -d /dev/video9 --list-formats-ext --all
...
...
...
ioctl:VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'MJPG'(Motion-JPEG, compressed)
Size: Discrete 1024x576
Interval:Discrete 0.033s (30.000fps)
Size: Discrete 1280x720
Interval:Discrete 0.033s (30.000fps)
Size: Discrete 896x504
Interval:Discrete 0.033s (30.000fps)
Size: Discrete 800x600
Interval:Discrete 0.033s (30.000fps)
Size: Discrete 640x480
Interval:Discrete 0.033s (30.000fps)
[1]: 'YUYV'(YUYV 4:2:2)
Size: Discrete 1280x720
Interval:Discrete 0.100s (10.000fps)
Size: Discrete 1024x576
Interval:Discrete 0.067s (15.000fps)
Size: Discrete 896x504
Interval:Discrete 0.100s (10.000fps)
Size: Discrete 800x600
Interval:Discrete 0.067s (15.000fps)
Size: Discrete 640x480
Interval:Discrete 0.033s (30.000fps)
可以看到,該USB攝像頭支持MPEG格式最高1280x720@30FPS輸出。03推流到電腦上
RK356X主板將USB攝像頭圖像推流到電腦上顯示。
3.1 主板安裝gst-rtsp插件
apt installgstreamer1.0-rtsp
apt installgstreamer1.0-rtsp
3.2 主板安裝mediamtx
mediamtx是一個rtsp server程序
root@ido:/home/ido# tar-xvfmediamtx_v1.1.1_linux_arm64v8.tar.gz
mediamtx
mediamtx.yml
LICENSE
root@ido:/home/ido# ./mediamtx&
[1]1315
root@ido:/home/ido# 2023/10/200204INFMediaMTXv1.1.1
2023/10/200204INF[RTSP]listeneropenedon:8554(TCP), :8000(UDP/RTP), :8001(UDP/RTCP)
2023/10/200204INF[RTMP]listeneropenedon:1935
2023/10/200204INF[HLS]listeneropenedon:8888
2023/10/200204INF[WebRTC]listeneropenedon:8889(HTTP)
2023/10/200204INF[SRT]listeneropenedon:8890(UDP)
3.3 主板開始RTSP推流
查看主板的IP地址:
root@ido:/home/ido# ifconfig
eth0:flags=4163 mtu 1500
inet 192.168.1.196netmask 255.255.255.0broadcast 192.168.1.255
inet6 fe80::d079c367:fea6 prefixlen 64scopeid 0x20
ether 86:41:8a:06:1d:7c txqueuelen 1000(Ethernet)
RX packets 52836bytes 38891607(38.8MB)
RX errors 0dropped 1overruns 0frame 0
TX packets 885065bytes 1255645741(1.2GB)
TX errors 0dropped 0overruns 0carrier 0collisions 0
device interrupt 40
lo:flags=73 mtu 65536
inet 127.0.0.1netmask 255.0.0.0
inet6 ::1prefixlen 128scopeid 0x10
loop txqueuelen 1000(Local Loopback)
RX packets 284667bytes 313713612(313.7MB)
RX errors 0dropped 0overruns 0frame 0
TX packets 284667bytes 313713612(313.7MB)
TX errors 0dropped 0overruns 0carrier 0collisions 0
使用gst-launch-1.0工具進行RTSP推流:
gst-launch-1.0v4l2src device=/dev/video9 \
! image/jpeg ! avdec_mjpeg ! videoconvert \
! video/x-raw,height=720,width=1280,frame=30/1,format=NV12 ! mpph264enc \
! rtspclientsink location=rtsp://127.0.0.1:8554/stream
3.4 電腦播放
電腦打開VLC軟件,點擊【媒體】->【打開網絡串流】->【網絡】,并輸入主板的RTSP推流地址和端口,然后點擊播放:
點擊播放按鈕后,即可看到USB攝像頭的圖像了:
04推流到RK356X主板
RK356X主板A將USB攝像頭推流到RK356X主板B上播放。
4.1 主板A安裝gst-rtsp插件
sudo apt installgstreamer1.0-rtsp
4.2 主板A安裝mediamtx
mediamtx是一個rtsp server程序
sudo apt installgstreamer1.0-rtsp
root@ido:/home/ido# tar-xvfmediamtx_v1.1.1_linux_arm64v8.tar.gz
mediamtx
mediamtx.yml
LICENSE
root@ido:/home/ido# ./mediamtx&
[1]1315
root@ido:/home/ido# 2023/10/200204INFMediaMTXv1.1.1
2023/10/200204INF[RTSP]listeneropenedon:8554(TCP), :8000(UDP/RTP), :8001(UDP/RTCP)
2023/10/200204INF[RTMP]listeneropenedon:1935
2023/10/200204INF[HLS]listeneropenedon:8888
2023/10/200204INF[WebRTC]listeneropenedon:8889(HTTP)
2023/10/200204INF[SRT]listeneropenedon:8890(UDP)
4.3 主板A開始RTSP推流
查看主板A的IP地址:
root@ido:/home/ido# ifconfig
eth0:flags=4163 mtu 1500
inet 192.168.1.196netmask 255.255.255.0broadcast 192.168.1.255
inet6 fe80::d079c367:fea6 prefixlen 64scopeid 0x20
ether 86:41:8a:06:1d:7c txqueuelen 1000(Ethernet)
RX packets 52836bytes 38891607(38.8MB)
RX errors 0dropped 1overruns 0frame 0
TX packets 885065bytes 1255645741(1.2GB)
TX errors 0dropped 0overruns 0carrier 0collisions 0
device interrupt 40
lo:flags=73 mtu 65536
inet 127.0.0.1netmask 255.0.0.0
inet6 ::1prefixlen 128scopeid 0x10
loop txqueuelen 1000(Local Loopback)
RX packets 284667bytes 313713612(313.7MB)
RX errors 0dropped 0overruns 0frame 0
TX packets 284667bytes 313713612(313.7MB)
TX errors 0dropped 0overruns 0carrier 0collisions 0
使用gst-launch-1.0工具進行RTSP推流:
gst-launch-1.0v4l2src device=/dev/video9 \
! image/jpeg ! avdec_mjpeg ! videoconvert \
! video/x-raw,height=720,width=1280,frame=30/1,format=NV12 ! mpph264enc \
! rtspclientsink location=rtsp://127.0.0.1:8554/stream
4.4 主板B拉流并播放
root@ido:~# gst-launch-1.0playbin uri=rtsp://192.168.1.196:8554/stream
Setting pipeline toPAUSED ...
Pipeline islive anddoes not need PREROLL ...
Progress:(open) Opening Stream
Progress:(connect) Connecting tortsp://192.168.1.196:8554/stream
Progress:(open) Retrieving server options
Progress:(open) Retrieving media info
Progress:(request) SETUP stream 0
Progress:(open) Opened Stream
Setting pipeline toPLAYING ...
New clock: GstSystemClock
Progress:(request) Sending PLAY request
Progress:(request) Sending PLAY request
Progress:(request) Sent PLAY request
mpp[1359]: mpp_rt:NOT found ion allocator
mpp[1359]: mpp_rt:found drm allocator
mpp[1359]: mpp_info: mpp version: 49f29006 author: Jeffy Chen 2021-08-04[drm]: Add mmap flag detection
mpp[1359]: hal_h264d_vdpu34x: control info: fmt 7, w1280, h 720
mpp[1359]: mpp_buf_slot:setframe info: w1280h 720hor 1280ver 720
mpp[1359]: mpp_dec: setting default w1280h 720h_str 1280v_str 720
mpp[1359]: h264d_api: is_avcC=1
-
usb
+關注
關注
60文章
7980瀏覽量
266081 -
主板
+關注
關注
53文章
1918瀏覽量
71392 -
攝像頭
+關注
關注
60文章
4862瀏覽量
96305
發布評論請先 登錄
相關推薦
米爾瑞芯微RK3576實測輕松搞定三屏八攝像頭
RK3576有多強?實測三屏八攝像頭輕松搞定
![<b class='flag-5'>RK</b>3576有多強?實測三屏八<b class='flag-5'>攝像頭</b>輕松搞定](https://file1.elecfans.com/web3/M00/06/26/wKgZPGeIYYOATCiqABNBTHdwW5k839.png)
ArmSoM RK3588/RK3576核心板,Rockchip攝像頭使用
![ArmSoM <b class='flag-5'>RK</b>3588/<b class='flag-5'>RK</b>3576核心板,Rockchip<b class='flag-5'>攝像頭</b>使用](https://file1.elecfans.com/web2/M00/EB/95/wKgZomZevfiAZTUiAAAYyNC3ogI340.png)
【米爾RK3576開發板評測】+項目名稱2、基于gstreamer + mpp硬件編碼 實現攝像頭推流
![](https://file1.elecfans.com/web3/M00/01/E5/wKgZO2dZOICAXDMjAAPql51sjiw197.jpg)
攝像頭及紅外成像的基本工作原理
![<b class='flag-5'>攝像頭</b>及紅外成像的基本工作原理](https://file1.elecfans.com/web2/M00/0D/33/wKgaomdD0wCAfJfJAAAKufzStAM990.jpg)
![](https://file1.elecfans.com/web2/M00/0B/BD/wKgaomcpeDeAFzAqAAP0j5DoZBg473.png)
NVIDIA多攝像頭追蹤工作流的應用架構
![NVIDIA多<b class='flag-5'>攝像頭</b>追蹤工作<b class='flag-5'>流</b>的應用架構](https://file1.elecfans.com/web2/M00/06/6E/wKgaombaoAyAVCnZAAYgKvWxEtE865.png)
攝像頭模塊突然無法顯示!!!可能是什么原因?
使用esp-iot-solution master分支的usb_stream攝像頭顏色不對是怎么回事?
![](https://file1.elecfans.com/web2/M00/EB/CB/wKgZomZfySaAB-i4AAbqwEwEL6E779.png)
USB無線WiFi圖傳模塊高清攝像頭測試:MR300C圖傳模塊 USB攝像頭內窺鏡轉WIFI網口WEBcam
輕輕松松在RK356X Android11適配ML307R Cat.1模組
![輕輕松松在<b class='flag-5'>RK356X</b> Android11適配ML307R Cat.1模組](https://file1.elecfans.com/web2/M00/8F/50/wKgZomTMciWAD54NAABOGP2pQZY452.png)
評論