ZCU102实时YUV码流输出方案:将摄像头采集的数据,输出YUV的码流数据!
功能:将实时YUV码流在ZCU102BSP上编码H265,通过RTP传输协议将H265视频数据打包发送到客服端,客服端上设置H265相关参数(IP、端口号、时钟频率等)在sdp文件中,使用VLC播放实时的H265码流。

搭建linux开发环境步骤:
(1)通过Vivado编译h265工程,生成system_wrapper.hdf和h265_soc_wrapper.bit文件;
(2)导出system_wrapper.hdf硬件描述文件,创建zcu102-base-trd工程;
(3)基于petalinux-bsp创建BOOT.BIN引导镜像文件,并基于ZCU102开发板的设备树创建image.ub镜像文件;
(4)通过Xilinx_SDK编译h265_sdk应用程序,生成h265_rtp.elf文件;
(5)将BOOT.BIN、image.ub和h265_rtp.elf可执行文件复制到SD卡中,如下图。

1、xilinx官网下载:
(1)petalinux-v2016.3-open_components.tar.gz:
https://www.xilinx.com/support/download/index.html/content/xilinx/en/dow...
(2)rdf0421-zcu102-base-trd-2016-3.zip:
https://china.xilinx.com/products/boards-and-kits/ek-u1-zcu102-g.html#do...
http://www.wiki.xilinx.com/Zynq+UltraScale+MPSoC+Base+TRD+2016.3+-+Desig...
---BOOT.BIN image.ub
(3)Xilinx_SDK_2017.4_1216_1_Win64.exe
(4)h265的FPGA工程---system_wrapper.hdf
(5)h265_sdk的应用程序---h265_rtp.elf
2、安装PetaLinux BSP,
安装petalinux需要的依赖环境
$ sudo apt-get install zlib1g
3、下载petalinux-v2016.3-open_components.tar.gz,安装过程中有3个许可需要同意
$ mkdir /opt/pkg
$ ./petalinux-v2016.3-final-installer.run /opt/pkg

4、关闭xilinx统计信息
$ petalinux-util --webtalk off
5、修改/bin/sh
shell中输入:dpkg-reconfigure dash,在出现的界面中选择‘否’

6、设置环境变量,并echo值如下
$ source /opt/pkg/settings.sh
$ echo $PETALINUX
7、安装Vivado 2016.4
编译h265工程,生成system_wrapper.hdf和h265_soc_wrapper.bit文件:
创建Generate Bitstream生成bit文件,放在rdf0421-zcu102-base-trd-2016-3工程中,并删除zcu102_base_trd_wrapper.bit文件。
$ cp h265_soc_wrapper.bit $TRD_HOME/apu/petalinux_bsp/images/linux

8、将硬件平台从Vivado工程导出硬件描述文件(.hdf)(h265工程自带)
- File -> Export -> Export to hardware
将导出的 hdf 文件,放在rdf0421-zcu102-base-trd-2016-3工程中。
$ cp system_wrapper.hdf $TRD_HOME/apu/petalinux_bsp/hw-description

9、创建rdf0421-zcu102-base-trd-2016-3工程
$ cd $TRD_HOME/apu/petalinux_bsp
$ petalinux-config --get-hw-description=./hw-description --oldconfig
10、选择设备树匹配设计模块5,创建image.ub镜像文件,运行petalinux-build编译工程
$ cd subsystems/linux/configs/device-tree
$ cp system-dm5.dts system-top.dts
$ LANG=C LC_LANG=C petalinux-build
$ cd -
11、创建BOOT.BIN引导镜像文件
设置dm6.bif文件,修改[destination_device=pl]为 h265_soc_wrapper.bit
$ cd images/linux
$ petalinux-package --boot --bif=dm6.bif --force

12、将BOOT.BIN和image.ub镜像文件复制到SD卡中
$ mkdir -p $TRD_HOME/images/dm5/bin
$ cp BOOT.BIN image.ub $TRD_HOME/images/dm5

13、安装Xilinx_SDK_2017.4_1216_1_Win64.exe
编译h265_sdk程序,run生成h265_rtp.elf文件
$ cp h265_rtp.elf $TRD_HOME/images/dm5

14、将SD卡插回,开机,串口打印信息(比特率115200)
开机时登录的用户名和密码都是root
挂载SD卡:
ifconfig eth0 172.16.1.122 netmask 255.255.0.0
route add default gw 172.16.1.1
mount -t nfs -o nolock -o tcp 172.16.1.112:/home/sinovo /mnt
mkdir /udisk
mount -t vfat /dev/mmcblk0p1 /udisk/
cd /udisk/h265_sw
./h265_rtp.elf 172.16.1.110

---------------------
作者:21cnhui
来源:CSDN
原文:https://blog.csdn.net/u010872301/article/details/81364914
版权声明:本文为博主原创文章,转载请附上博文链接!