1、使用deyaio编译带有rtsp服务器支持的镜像,或是直接下载预编译的镜像,刷到开发板或设备中
要自己编译,可以在conf/local.conf中加入这些:
# 启用 gst-plugins-ugly 的 x264 支持 PACKAGECONFIG:append:pn-gstreamer1.0-plugins-ugly = " x264" # 接受 GPL 许可证(如果需要) LICENSE_FLAGS_ACCEPTED = "commercial_gpl" # 在 local.conf 中添加 GLIBC_GENERATE_LOCALES = "zh_CN.UTF-8 en_GB.UTF-8 en_US.UTF-8" IMAGE_LINGUAS = "zh-cn" LOCALE_UTF8_ONLY="1" IMAGE_INSTALL:append = " gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-rtsp-server ffmpeggstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-base-apps x264 libjpeg-turbo libpng zlib nano tmux localedef glibc-utils v4l-utils" IMAGE_INSTALL:remove = " cccs connectcore-demo-example"
2、连上并上电 若要支持10寸lvds屏,一并连接好,设置一下overlays,也可用默认hdmi显示屏或不接屏
连接摄像头,console线,上电进入linux
3、测试摄像头
先用v4l2-ctl –list-devices 列出所有,其中前两个是vpu和相关通道,最后一个是摄像头节点。
在显示屏上查看摄像头的视频,可以用
gst-launch-1.0 v4l2src device=/dev/video2 ! autovideoconvert ! autovideosink
查看摄像头支持的格式,用
v4l2-ctl --list-formats-ext -d /dev/video2
查看摄像头的默认输出格式,用
v4l2-ctl -d /dev/video2 --get-fmt-video
设置摄像头的格式,可以用下面命令,注意你要设置硬件所支持的范围
v4l2-ctl -d /dev/video2 --set-fmt-video=width=640,height=480,pixelformat=YUYV