Featured image of post Execute RTSP Server on KV260

Execute RTSP Server on KV260

Steps

# move petalinux-v2021.1-final-installer.run to Ubuntu 18.04.5

sudo apt update
sudo apt install g++
sudo apt install xterm autoconf libtool texinfo zlib1g-dev gcc-multilib build-essential ncurses-*

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install zlib1g:i386

sudo apt-get install tftpd tftp openbsd-inetd
sudo nano /etc/inetd.conf
# 新增以下內容
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftproot
# 存檔並關閉
sudo mkdir /tftproot
sudo chmod 777 /tftproot
sudo /etc/init.d/openbsd-inetd restart

./petalinux-v2021.1-final-installer.run --dir ./petalinux
sudo apt install gcc-multilib
source ./petalinux/settings.sh

petalinux-create -t project -s xilinx-k26-starterkit-v2021.1-final.bsp -n kv260_smartcam

nano ./kv260_smartcam/project-spec/meta-user/conf/petalinuxbsp.conf
# 移除以下內容
misc-config
# 存檔並關閉

cd ./kv260_smartcam

petalinux-config -c rootfs
# Filesystem Packages->multimedia->gstreamer-1.0
# Filesystem Packages->misc->gstreamer-1.0-meta-base

petalinux-build -s # 等好久喔(大約兩小時)
petalinux-package --sysroot
cd ./images/linux/sdk
unset LD_LIBRARY_PATH
source environment-setup-cortexa72-cortexa53-xilinx-linux

# 搬移 rtsp_server_app 到 user 底下
cd ~/rtsp_server_app/

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

sudo apt-get install libgstreamer1.0-dev
sudo apt install libjson-glib-dev
sudo apt install gstreamer1.0-

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools

sudo apt-get install libgstrtspserver-1.0-dev gstreamer1.0-rtsp
sudo apt-get install gtk-doc-tools libglib2.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev -y

sh build.sh

./rtsp_server_app "( v4l2src name=videosrc device=/dev/video0 io-mode=mmap stride-align=256  ! video/x-raw, width=1920, height=1080 ! videoconvert ! video/x-raw, format=NV12  ! tee name=t  ! queue ! ivas_xmultisrc kconfig="/opt/xilinx/share/ivas/smartcam/facedetect/preprocess.json"  ! queue ! ivas_xfilter kernels-config="/opt/xilinx/share/ivas/smartcam/facedetect/aiinference.json"  ! ima.sink_master ivas_xmetaaffixer name=ima ima.src_master ! fakesink  t. ! queue max-size-buffers=1 leaky=2 ! ima.sink_slave_0 ima.src_slave_0  ! queue ! ivas_xfilter kernels-config="/opt/xilinx/share/ivas/smartcam/facedetect/drawresult.json"  ! queue ! ivas_xroigen roi-type=1 roi-qp-delta=-10 roi-max-num=10   ! queue ! omxh264enc qp-mode=1 num-slices=8 gop-length=60  periodicity-idr=270 control-rate=low-latency  gop-mode=low-delay-p gdr-mode=horizontal cpb-size=200  initial-delay=100  filler-data=false min-qp=15  max-qp=40  b-frames=0  low-bandwidth=false  target-bitrate=3000 ! video/x-h264, alignment=au ! queue ! rtph264pay name=pay0 pt=96 )"

 

Licensed under CC BY-NC-SA 4.0