网上购买了一块hi3516ev300的开发板,收到开发板后,把rtsp播放的基本功能验证了下,摄像头和MIC功能都正常;
接下来期望是调通sdk版本中sample代码的视频录制和声音录制功能;
平台:Hi3516ev300
调试手段:gdb,日志;
SDK: Hi3516E V200R001C01SPC012
参考代码:https://github.com/lmshao/HisiLive
1、配置ip、路由,网络挂载nfs,将ko文件拷贝到nfs共享路径,然后加载驱动;
ifconfig eth0 192.168.0.10 netmask 255.255.255.0 route add default gw 192.168.0.254 mount -t nfs -o nolock -o tcp -o rsize=32768,wsize=32768 192.168.16.83:/home/lyz/work/nfs/ /nfs ./load3516ev300 -a -sensor0 imx335 -osmem 32M -offline
2、修改参数,重新编译venc;
sdk sample代码路径: Hi3516EV200R001C01SPC012\01.software\board\Hi3516EV200_SDK_V1.0.1.2\Hi3516EV200_SDK_V1.0.1.2\package\mpp\mpp\sample\venc
视频录制是\sample\venc的例子,要跑通这个例子,需要手动修改sample路径下的Makefile.param ,将其中的SENSOR0_TYPE 修改为你对应开发板的sensor类型;
################# select sensor type for your sample ################# #### SONY_IMX335_MIPI_5M_30FPS_12BIT ################# #### SONY_IMX335_MIPI_4M_30FPS_12BIT ################# #### SONY_IMX327_MIPI_2M_30FPS_12BIT ################# #### SONY_IMX327_MIPI_2M_30FPS_12BIT_WDR2TO1 ################# #### SONY_IMX307_MIPI_2M_30FPS_12BIT ################# #### SONY_IMX307_MIPI_2M_30FPS_12BIT_WDR2TO1 ################# #### SONY_IMX335_MIPI_4M_30FPS_10BIT_WDR2TO1 ################# #### OMNIVISION_OS05A_MIPI_5M_30FPS_12BIT ################# #### BT1120_2M_30FPS_8BIT ################# #### the previous sequence only for Hi3516EV300,Hi3516DV200 etc. ##### #### BT656_2M_30FPS_8BIT ################# #### SONY_IMX307_2L_MIPI_2M_30FPS_12BIT ################# #### SONY_IMX307_2L_MIPI_2M_30FPS_12BIT_WDR2TO1 ################# #### SONY_IMX327_2L_MIPI_2M_30FPS_12BIT ################# #### SONY_IMX327_2L_MIPI_2M_30FPS_12BIT_WDR2TO1 ################# #### SMART_SC4236_MIPI_3M_30FPS_10BIT ################# #### SMART_SC4236_MIPI_3M_20FPS_10BIT ################# #### SMART_SC2235_DC_2M_30FPS_10BIT ################# #### SMART_SC2231_MIPI_2M_30FPS_10BIT ################# #### SOI_JXF37_MIPI_2M_30FPS_10BIT ################# #### SMART_SC3235_MIPI_3M_30FPS_10BIT ################# #### GALAXYCORE_GC2053_MIPI_2M_30FPS_10BIT ################# #### GALAXYCORE_GC2053_MIPI_2M_30FPS_10BIT_FORCAR ################# SENSOR0_TYPE ?= SONY_IMX307_2L_MIPI_2M_30FPS_12BIT
3、将HisiLive代码合入到venc,修改sample_venc.c ,把rtp推流的逻辑串起来;
vlc 播放sdp:
m=video 1234 RTP/AVP 96 a=rtpmap:96 H264/90000 a=framerate:25 c=IN IP4 127.0.0.1 s=Sample Video
模块执行./HisiLive -m rtp -i 192.168.16.71 给1234端口推送h264的rtp包;
4、完整代码,提交仓库:https://gitee.com/aiprogrammer/hi3516ev300_rtp_view
5、遗留问题:
aac录制的sample_audio 能正常运行,但录制完成后的aac没有声音,是不是很奇怪,后面继续跟踪解决吧;
-----20220527更新-----
录音没有声音的问题,参考https://blog.csdn.net/cocoron/article/details/105394614#comments_18535459 修改后,mic录制文件有声音;
遗留解码aac文件播放没有声音的问题,继续搞!
rtsp server的思路是:
camera输出持续往一个环形缓冲区去写,如果有客户端接入,则将环形缓冲区中的视频包转发给rtsp客户端;
-------------------广告线---------------
项目、合作,欢迎勾搭,邮箱:promall@qq.com
本文为呱牛笔记原创文章,转载无需和我联系,但请注明来自呱牛笔记 ,it3q.com