这是本文档旧的修订版!


deyaio-manifest的rtsp分支,用rtsp.xml,使用meta-custom的rtsp分支

启动后,由于移除busybox-httpd,改用sthttpd,所以报错busybox-httpd服务无法启动,未来需要把服务改成sthttpd

检查:下面这些可能要手动关闭或从服务中移除

 986 root     34388 S    /usr/bin/cccsd -d
 997 root      3848 S    {cccs-gs-demo} /bin/sh /etc/cccs-gs-demo start
 1004 root      9360 S    /usr/bin/cccs-gs-demo

检查wifi的功能:

iw reg get
没设置时,创建nano /etc/systemd/system/set-regdomain.service
另外,wlan1是用来设置ap的,创建
nano /etc/udhcpd.conf

interface       wlan1
start           192.168.46.100
end             192.168.46.200
max_leases      10
opt router      192.168.46.30
opt lease       86400

nano /etc/systemd/system/udhcpd.service

[Unit]
Description=DHCP Server
After=network-online.target hostapd@wlan1.service
Wants=network-online.target

[Service]
ExecStart=/usr/sbin/udhcpd -f /etc/udhcpd.conf
Restart=on-failure
RestartSec=5s
StartLimitInterval=0

[Install]
WantedBy=multi-user.target


修改/etc/network/interfaces

auto wlan1
iface wlan1 inet static
        address 192.168.46.30
        netmask 255.255.255.0
        pre-up [ -d /proc/device-tree/wireless ]
        post-up systemctl start hostapd@wlan1.service
        post-up udhcpd /etc/udhcpd.conf
        pre-down systemctl stop hostapd@wlan1.service
        pre-down pkill udhcpd

* 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"

nxp用了一个IMAGE_INSTALL:append = “ gst-variable-rtsp-server” ,原来的gstreamer1.0-rtsp-server不会被编译

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

手动测试:

pkill hostapd
pkill udhcpd
ip link set wlan1 down
ip link set wlan1 up

hostapd -B /etc/hostapd_wlan1.conf
udhcpd -f -v /etc/udhcpd.conf