树莓派摄像头使用方法 Camera教程
https://www.raspi.cc/index.php?c=read&id=53&page=1
nanopc-t4
https://www.raspi.cc/index.php?c=read&id=53&page=1
摄像头型号
Raspberry Pi Camera Rev 1.3
检测故障
dmesg | grep -i mipi
pi@NanoPC-T4:~$ dmesg | grep -i mipi
[ 2.528023] rockchip-mipi-dphy-rx: No link between dphy and sensor
[ 2.528584] rockchip-mipi-dphy-rx: No link between dphy and sensor
[ 2.530501] rockchip-mipi-dphy-rx: No link between dphy and sensor
[ 2.531073] rockchip-mipi-dphy-rx: No link between dphy and sensor
https://wiki.friendlyelec.com/wiki/index.php/NanoPC-T4/zh#gst-camera.sh_.E5.8F.82.E6.95.B0.E8.AF.B4.E6.98.8E
运行
gst-camera.sh --action preview
报错
gst-launch-1.0: no process found
/usr/bin/gst-camera.sh: line 178: [: =: unary operator expected
====================================================
=== GStreamer 1.1 command:
=== gst-launch-1.0 v4l2src device= io-mode=4 ! videoconvert ! video/x-raw,format=NV12, !
====================================================
/usr/bin/gst-camera.sh: line 194: [: too many arguments
su: must be run from a terminal
运行
sudo gst-camera.sh --action preview
报错
gst-launch-1.0: no process found
/usr/bin/gst-camera.sh: line 178: [: =: unary operator expected
====================================================
=== GStreamer 1.1 command:
=== gst-launch-1.0 v4l2src device= io-mode=4 ! videoconvert ! video/x-raw,format=NV12, !
====================================================
/usr/bin/gst-camera.sh: line 194: [: too many arguments
ERROR: pipeline could not be constructed: could not parse caps "video/x-raw,format=NV12,".
gst - launch - 1.0
是 GStreamer 多媒体框架中的一个命令行工具。GStreamer 是一个用于构建流媒体应用程序的库,它允许开发者创建各种多媒体处理管道,包括音频和视频的播放、录制、编辑以及格式转换等功能。
sudo apt-get update
sudo apt-get install gstreamer1.0-tools
sudo apt-get install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
sudo apt-get install gstreamer1.0-tools
gst-launch-1.0(注意,应替换为实际管道)。
查看gst-launch-1.0是否正常,以下命令会播放测试视频
gst-launch-1.0 videotestsrc ! autovideosink
输出没问题,证明gst-launch-1.0正常,接下来排除摄像头驱动的故障
https://cloud.tencent.com/developer/article/1421907
推流
教程:
https://zhuanlan.zhihu.com/p/668110375
https://juejin.cn/post/7310046632672919578
linux推流教程
https://blog.youkuaiyun.com/weixin_54613775/article/details/137523538
https://blog.youkuaiyun.com/qq_40959462/article/details/129208947
https://blog.youkuaiyun.com/aiq8620/article/details/101265706
rm -rf ~/.config/obs-studio/plugins/obs-rtspserver/bin/64bit/
rm -rf ~/.config/obs-studio/plugins/obs-rtspserver/data/
rm -rf ~/obs-rtspserver-linux
8.1安装开源视频流服务器EasyDarwin
在https://github.com/EasyDarwin/EasyDarwin/releases下载文件
|
8.2解压文件,unzip EasyDarwin-linux-x86_64-v7.2.17.0308.zip
8.3将EasyDarwin-linux-x86_64-v7.2.17.0308.zip中的文件easydarwin.xml复制到/etc/streaming中,切换至EasyDarwin-linux-x86_64-v7.2.17.0308目录启动软件 ./easydarwin
8.4下载所需视频
mkdir -p /data/video
cd /data/video
wget https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection-inferen
ce/video.tar.gz
tar -zxvf video.tar.gz
8.5安装rtsp服务,安装live555或mediamtx,在https://github.com/bluenviron/mediamtx
/releases中下载mediamtx
|
8.6切换至mediamtx目下,启动服务./mediamtx
|
8.7进行推流ffmpeg -re -i /data/video/video.mp4 -vcodec libx264 -f rtsp rtsp://localhost:8554/video
|