Toybrick

标题: RK3399Pro入门教程(10)RTSP推流介绍 [打印本页]

作者: hisping    时间: 2019-9-29 11:50
标题: RK3399Pro入门教程(10)RTSP推流介绍
[attach]607[/attach]


本教程讲解如何基于TB-RK3399proD开发板进行RTSP推流,并可在远程使用vlc进行播放

本教程demo为教学用例,进行3小时拷机测试正常,若用户想商用还需自行优化;用户也可以使用其他推流框架配合rockchip mpp编解码库进行RTSP推流



开发板:TB-RK3399proD

系统、固件:采用fedora28系统(固件v1.5测试通过),Debian10测试通过

推流框架:live555

编解码库:rockchip mpp编解码库

图像数据:usb摄像头



1. 环境安装

fedora28系统
  1. sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
  2. sudo dnf install live555-devel
  3. sudo dnf install ffmpeg-devel

  4. sudo dnf install librockchip_mpp-devel
  5. sudo dnf install librockchip_rga-devel
复制代码

Debian10系统
  1. 第一次更新:
  2. 1. 更新源:sudo apt update --fix-missing
  3. 2. 升级软件包:sudo apt -y upgrade
  4. 注意:升级过去中会有提示确认是否提供/etc/apt/sources.list.d/toybrick.list,请输入"Y"
  5. 3. 再次更新源:sudo apt update

  6. 后续更新:
  7. sudo apt update
  8. sudo apt upgrade

  9. 安装依赖:
  10. sudo apt install liblivemedia-dev
  11. sudo apt install livemedia-utils
  12. sudo apt install ffmpeg
  13. sudo apt install libavcodec-dev
  14. sudo apt install libswscale-dev
  15. sudo apt install libavformat-dev
  16. sudo apt install vlc
  17. sudo apt install rockchip-mpp-dev
  18. sudo apt install rockchip-rga-dev
复制代码


2.下载并解压附件[attach]608[/attach] for fedora
[attach]894[/attach] for debian

3. 编译执行

  1. cd IPCamera/
  2. make clean
  3. make
  4. ./RTSPServer
复制代码
运行时会打印URL地址,ip不固定,所以以实际打印为准,我这里是"rtsp://172.16.9.3:8554/h264ESVideoTest",后续播放就使用该地址


4.使用vlc进行播放,我这里直接在板子上安装vlc,用户也可以在PC上使用vlc播放
  1. sudo dnf install vlc
  2. vlc
复制代码

"media"--"Open Network Stream"--"rtsp://172.16.9.3:8554/h264ESVideoTest"--"Play"


运行效果如下

[attach]609[/attach]



代码分析

V4L2.cpp

  1. void V4L2FramedSource::doGetNextFrame()
  2. {
  3.         long bigin = get_time();

  4.           registerOutputInterest();

  5.           while(fTotOfFrameToSend<fMaxOfFrameToSend)
  6.           {
  7.                     convernt_to_OutputBuffer();
  8.           }
  9.         long end = get_time();
  10.         printf("V4L2FramedSource::doGetNextFrame use %d \n", end - bigin);
  11.           //统计返回信息
  12.           fFrameSize=fNumValidDataBytes;//一次一帧图像
  13.          fNumTruncatedBytes = 0;

  14.           reset();
  15.         afterGetting(this);
  16. }
复制代码
从usb摄像头获取一帧数据,转化成NV12格式


StreamEncoder.cpp

  1. void StreamEncoder::continueReadProcessing1(unsigned frameSize,unsigned numTruncatedBytes,
  2.                                           struct timeval presentationTime,
  3.                                           unsigned durationInMicroseconds){

  4.           fNumTruncatedBytes = numTruncatedBytes;
  5.           fPresentationTime = presentationTime;
  6.           fDurationInMicroseconds = durationInMicroseconds;

  7.           encoder_to_h264();

  8.               if(fNumValidDataBytes+dstsize<fOutputBufferSize && fTotOfFrameToSend<fMaxOfFrameToSend)
  9.               {
  10.                 copy_to_outputbuffer();               
  11.               }

  12.         fFrameSize = fNumValidDataBytes;
  13.         gettimeofday(&fPresentationTime, NULL);
  14.         reset();
  15.               FramedSource::afterGetting(this);         
  16. }
复制代码
使用rockchip mpp库进行h264编码





作者: yuys    时间: 2019-10-17 15:22
在局域网里,在PC 端口,通过opencv获取板子上的推流,PC上显示非常容易出现卡死。
作者: hjf515    时间: 2019-10-26 16:11
非常不错,这个例子的关键应该是将相关开源库中的视频编码采用MPP中的硬件编码单元。
能否提供一个教程,介绍开源库 如何 适配rockchip MPP RGA等库。
作者: you_big_father    时间: 2019-12-8 15:35
你好,视频无法打开提示如下:
[root@localhost IPCamera]# ./RTSPServer

"h264ESVideoTest" stream, from the file "test.264"
Play this stream using the URL "rtsp://202.204.53.161:8554/h264ESVideoTest"

(We use port 80 for optional RTSP-over-HTTP tunneling.)

camera driver name is : uvcvideo
camera device name is : LRCP  USB2.0
camera bus information: usb-xhci-hcd.11.auto-1.4
Success in VIDIOC_S_FMT
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
creater
pictureSize=460800
SDP Info:a=fmtp:96 packetization-mode=1;profile-level-id=000000;sprop-parameter-sets=H264

__StreamEncoder::H264_encode_close__
closed the camera!

camera driver name is : uvcvideo
camera device name is : LRCP  USB2.0
camera bus information: usb-xhci-hcd.11.auto-1.4
Success in VIDIOC_S_FMT
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
creater
pictureSize=460800
__DD_H264VideoFileServerMediaSubsession::startStream__
StreamOn success!
Open file(/boot/toybrick-release) failed
rgaCreate error!

Open file(/boot/toybrick-release) failed
rgaCreate error!

Open file(/boot/toybrick-release) failed
rgaCreate error!

Open file(/boot/toybrick-release) failed
rgaCreate error!



作者: you_big_father    时间: 2019-12-8 16:36
you_big_father 发表于 2019-12-8 15:35
你好,视频无法打开提示如下:
[root@localhost IPCamera]# ./RTSPServer

我自己解决了,用直接安装的RGA会出问题,先到《RK3399Pro入门教程(5)图形加速引擎RGA的使用》里下载RGA源码,放到这个教程目录下,修改一下makefile就行了
作者: sjq_cyy    时间: 2019-12-9 15:58
我也遇到了同样的问题,
[attach]778[/attach]
楼上能贴下是如何把rga的代码融合到这个工程里面的吗?
非常感谢

作者: you_big_father    时间: 2019-12-11 20:38
sjq_cyy 发表于 2019-12-9 15:58
我也遇到了同样的问题,

楼上能贴下是如何把rga的代码融合到这个工程里面的吗?

你好  我才看到你的问题。
就是将rga例程的“rockchip_rga”文件夹源码放到RTSP例程根目录下,头文件放到RTSP的include文件夹下,makefile文件里加上RGA源文件会生成的 .o 文件,再修改V4L2.H文件将“#include <rockchip/rockchip_rga.h>”的“rockchip/”去掉就行了。
作者: seanx    时间: 2019-12-18 14:38
今天也遇到了这个问题,最终发现是用dnf update更新了mpp、rga、drm几个库导致的,将这几个库降级到之前的版本就不会再报“Open file(/boot/toybrick-release) failed”了。
作者: xiayip    时间: 2019-12-26 18:06
看到介绍里说RK3399pro是支持AFBC的,那请问要如何启用这个技术呢?需要手动启用吗?还是说系统会自己决定何时启用?
作者: Carlos    时间: 2019-12-30 09:24
大佬,我想知道板子上是linux系统的话,操作步骤是怎样的
作者: Carlos    时间: 2020-1-6 17:45
我执行了一下程序,它报的信息是这样的:
[358813.708211] rk_vcodec: vpu2_enc task: 3 ms
[358813.710587] rk-vcodec ff650000.vpu_service: closed
[358813.738622] rk_vcodec: vpu2_enc task: 3 ms
[358813.740911] rk-vcodec ff650000.vpu_service: closed
[358813.769701] rk_vcodec: vpu2_enc task: 3 ms
[358813.771808] rk-vcodec ff650000.vpu_service: closed
[358813.801404] rk_vcodec: vpu2_enc task: 3 ms
[358813.803660] rk-vcodec ff650000.vpu_service: closed
[358813.829368] rk_vcodec: vpu2_enc task: 3 ms
[358813.839999] rk-vcodec ff650000.vpu_service: closed
[358813.882892] rk_vcodec: vpu2_enc task: 3 ms
[358813.884686] rk-vcodec ff650000.vpu_service: closed
[358813.922180] rk_vcodec: vpu2_enc task: 3 ms
[358813.924092] rk-vcodec ff650000.vpu_service: closed
[358813.960250] rk_vcodec: vpu2_enc task: 3 ms
[360440.595181] rk-vcodec ff650000.vpu_service: closed
摄像头rtsp推流后,画面就出现了几秒,之后就黑屏断开了
作者: Carlos    时间: 2020-1-6 17:49
我执行了一下程序,它报的信息是这样的:
[358813.708211] rk_vcodec: vpu2_enc task: 3 ms
[358813.710587] rk-vcodec ff650000.vpu_service: closed
[358813.738622] rk_vcodec: vpu2_enc task: 3 ms
[358813.740911] rk-vcodec ff650000.vpu_service: closed
[358813.769701] rk_vcodec: vpu2_enc task: 3 ms
[358813.771808] rk-vcodec ff650000.vpu_service: closed
[358813.801404] rk_vcodec: vpu2_enc task: 3 ms
[358813.803660] rk-vcodec ff650000.vpu_service: closed
[358813.829368] rk_vcodec: vpu2_enc task: 3 ms
[358813.839999] rk-vcodec ff650000.vpu_service: closed
[358813.882892] rk_vcodec: vpu2_enc task: 3 ms
[358813.884686] rk-vcodec ff650000.vpu_service: closed
[358813.922180] rk_vcodec: vpu2_enc task: 3 ms
[358813.924092] rk-vcodec ff650000.vpu_service: closed
[358813.960250] rk_vcodec: vpu2_enc task: 3 ms
[360440.595181] rk-vcodec ff650000.vpu_service: closed
摄像头rtsp推流后,画面就出现了几秒,之后就黑屏断开了
作者: lodestar    时间: 2020-2-15 15:25
运行时,提示出错can't support video capture!
请教下,要如何处理? 谢谢
作者: lodestar    时间: 2020-2-15 15:29
[toybrick@toybrick IPCamera]$ make
c++ -c -I./include -I/usr/include -I/usr/include/ffmpeg -I/usr/include/groupsock -I/usr/include/liveMedia -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment -Wall V4L2.cpp
In file included from V4L2.cpp:12:
./include/V4L2.hh:28:11: fatal error: libavcodec/avcodec.h: No such file or directory
  #include <libavcodec/avcodec.h>
           ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:21: V4L2.o] Error 1
作者: cr7jj    时间: 2020-2-27 16:01
你好,在Debian系统怎么安装所需环境,ffmpeg,live555之类的,在Debian用你们这个代码可以吗
作者: cr7jj    时间: 2020-3-6 16:45
你好,在Debian10怎么安装所需环境,ffmpeg,live555不能安装的,现在用你们的提供的代码编译成功,用vlc不能播放。
作者: cr7jj    时间: 2020-3-10 10:40

我在TB-RK3399ProD,Debian10系统 ,usb镜头
用你们的示例代码
现在编译通过,用vlc不能播放。出现以下错误。请问如何解决
  1.   end open_camera
  2.     creater
  3.     pictureSize=460800
  4.     __DD_H264VideoFileServerMediaSubsession::startStream__
  5.     StreamOn success!
  6.     V4L2FramedSource::doGetNextFrame use 120
  7.     mpp_rt: NOT found ion allocator
  8.     mpp_rt: found drm allocator
  9.     mpi: mpp version: Without VCS info
  10.     h264e_api: h264e_config MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000]
  11.     encoded frame 0 size 913
  12.     encode max 1 framesmpi_enc_test success total frame 1 bps 219120
  13.     StreamEncoder::doGetNextFrame() use 151
  14.     V4L2FramedSource::doGetNextFrame use 18
  15.     mpi: mpp version: Without VCS info
  16.     h264e_api: h264e_config MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000]
  17.     encoded frame 0 size 920
复制代码


作者: hisping    时间: 2020-3-11 18:02
cr7jj 发表于 2020-3-10 10:40
我在TB-RK3399ProD,Debian10系统 ,usb镜头
用你们的示例代码
现在编译通过,用vlc不能播放。出现以下错 ...

新增IPCamera-debian.zip附件,你再试试
作者: cr7jj    时间: 2020-3-12 16:52
hisping 发表于 2020-3-11 18:02
新增IPCamera-debian.zip附件,你再试试

TB-RK3399ProD,Debian10系统 ,usb镜头
vlc播放图像正常,但用官方提供的RK3399Pro入门教程(7)RTSP库里的local_rtsp.zip获取,图像色彩不正常,我觉得是图像格式的问题,麻烦帮忙看一下,代码在哪里需要修改一下呢,谢谢呀
作者: jefferyzhang    时间: 2020-3-13 15:44
本帖最后由 jefferyzhang 于 2020-3-13 16:09 编辑
cr7jj 发表于 2020-3-12 16:52
TB-RK3399ProD,Debian10系统 ,usb镜头
vlc播放图像正常,但用官方提供的RK3399Pro入门教程(7)RTSP库 ...

kernel更新下就可以了:

sudo apt update
sudo apt upgrade
sudo apt install boot-linux-prod
然后记得reboot设备,就可以了

作者: qingqiaong    时间: 2020-3-24 10:34
RK3399Pro做集成的开发权限问题怎么解决
作者: appleUncle    时间: 2020-4-1 16:19
you_big_father 发表于 2019-12-11 20:38
你好  我才看到你的问题。
就是将rga例程的“rockchip_rga”文件夹源码放到RTSP例程根目录下,头文件放到 ...

dnf downgrade librockchip_rga-devel解决问题
作者: appleUncle    时间: 2020-4-1 16:20
appleUncle 发表于 2020-4-1 16:19
dnf downgrade librockchip_rga-devel解决问题

对于这个问题我相当无语
作者: appleUncle    时间: 2020-4-3 19:02
版主给的代码有毒!!!!运行起来会间歇性瘫痪,蹦出如下错误:
__StreamEncoder::H264_encode_close__

整整花了我三天时间,gdb,一步步进去定位发现是sdp信息为空,DD_H264VideoFileServerMediaSubsession.cpp文件里面getAuxSDPLine函数少了一句代码!!!!
  1. char const* DD_H264VideoFileServerMediaSubsession::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource)
  2. {
  3.           char const* auxSDPLine = rtpSink->auxSDPLine();
  4.           if (auxSDPLine != NULL)
  5.           {
  6.                     return auxSDPLine;
  7.           }
  8.           else
  9.           {
  10.                     char const* fmtpFmt = "a=fmtp:%d packetization-mode=1"
  11.                                               ";profile-level-id=000000"
  12.                                               ";sprop-parameter-sets=H264\r\n";

  13.                     unsigned fmtpFmtSize = strlen(fmtpFmt)+3/* max char len */;

  14.                     char* fmtp = new char[fmtpFmtSize];
  15.                     delete[] fAuxSDPLine;
  16.                         //缺少下面这一句,调了3天,F**K!!
  17.                         memcpy(fmtp,fmtpFmt,fmtpFmtSize*sizeof(char));
  18.                     fAuxSDPLine = fmtp;
  19.                     return fAuxSDPLine;
  20.           }
  21. }
复制代码

作者: appleUncle    时间: 2020-4-3 19:06
本帖最后由 appleUncle 于 2020-4-9 08:37 编辑
appleUncle 发表于 2020-4-3 19:02
版主给的代码有毒!!!!运行起来会间歇性瘫痪,蹦出如下错误:
__StreamEncoder::H264_encode_close__

非常热切期望rk能继续放出优秀的demo,就算有毒俺们也至少能有的用啊
作者: wpkj@2020    时间: 2020-4-21 16:00
大神好,我下载了debian版本的代码,但是编译的时候各种报错,有操作的步骤吗
作者: wpkj@2020    时间: 2020-4-26 16:28
你好,请问是怎样解决的
作者: cr7jj    时间: 2020-5-5 11:33
hisping 发表于 2020-3-11 18:02
新增IPCamera-debian.zip附件,你再试试

新增IPCamera-debian.zip附件,怎么使用rga
作者: fangb    时间: 2020-5-19 16:58
我用这个demo推1920*1080的时候延迟很高,有什么优化设置吗
作者: fangb    时间: 2020-5-20 09:11
fangb 发表于 2020-5-19 16:58
我用这个demo推1920*1080的时候延迟很高,有什么优化设置吗

好吧  uvc相机拿高分辨率yuv数据很慢,和编解码没关系
作者: lwf4097    时间: 2020-6-10 16:54
各位大神,请教一个问题:MppPacket包直接fwrite文件,播放时没有进度条,且只能用QQ播放器,怎么解决?
作者: 昆仑    时间: 2020-8-28 01:02
运行debian版本demo, vlc播放一会儿后中断,报错:
mpp[12923]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[12923]: mpp_buffer: mpp_buffer_create failed to create buffer with size 464896
mpp[12923]: mpp_log: hw_rec_buf[0] get failed
mpp[12923]: hal_h264e_vepu2: hal_h264e_vepu2_gen_regs update buffers error.
mpp[12923]: mpp_enc: mpp 0x559cf599e0 hal_reg_gen failed return -1
packet is NULL
mpi_enc_test success total frame 0 bps 0
StreamEncoder::doGetNextFrame() use 39
V4L2FramedSource::doGetNextFrame use 43
mpi_enc_test start
mpi_enc_test encoder test start w 640 h 480 type 7
mpp[12923]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[12923]: h264e_api: h264e_config MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000]
mpp[12923]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[12923]: mpp_buffer: mpp_buffer_create failed to create buffer with size 1920
mpp[12923]: mpp_log: hw_nal_size_table_buf get failed
mpp[12923]: hal_h264e_vepu2: hal_h264e_vepu2_gen_regs update buffers error.
mpp[12923]: mpp_enc: mpp 0x7f78003dc0 hal_reg_gen failed return -1
packet is NULL
mpi_enc_test success total frame 0 bps 0
StreamEncoder::doGetNextFrame() use 54
V4L2FramedSource::doGetNextFrame use 42
mpi_enc_test start
mpi_enc_test encoder test start w 640 h 480 type 7
mpp[12923]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[12923]: h264e_api: h264e_config MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000]
mpp[12923]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[12923]: mpp_buffer: mpp_buffer_create failed to create buffer with size 307200
mpp[12923]: mpp_packet: mpp_packet_init_with_buffer invalid input packet 0x7f7f265228 buffer (nil)
mpp[12923]: mpp_packet: check_is_mpp_packet pointer (nil) failed on check
Segmentation fault
请问这是什么原因?
作者: 荪荪    时间: 2020-9-21 10:51
可以在虚拟机上搭建环境吗?
作者: xiaqing10    时间: 2020-10-14 15:56
想问下,理论上的延时是多少。
目前,将rtsp接收端重写了下,发现640*480的usb采集的视频,在局域网内推流动,延时都是300ms左右,想提升到150ms,有具体的改进方法么?
或者有没有更高效的推流框架?

作者: guozhaozhong    时间: 2020-11-7 15:18
you_big_father 发表于 2019-12-11 20:38
你好  我才看到你的问题。
就是将rga例程的“rockchip_rga”文件夹源码放到RTSP例程根目录下,头文件放到 ...

要修改,V4L2.cpp,不是 V4L2.h
作者: guozhaozhong    时间: 2020-11-7 17:00
[toybrick@localhost IPCamera]$ ./RTSPServer

"h264ESVideoTest" stream, from the file "test.264"
Play this stream using the URL "rtsp://172.23.100.12:8554/h264ESVideoTest"

(We use port 8000 for optional RTSP-over-HTTP tunneling.)

camera driver name is : uvcvideo
camera device name is : USB2.0 Camera
camera bus information: usb-xhci-hcd.9.auto-1.2
Success in VIDIOC_S_FMT
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
creater
pictureSize=460800
SDP Info:a=fmtp:96 packetization-mode=1;profile-level-id=000000;sprop-parameter-sets=H264

__StreamEncoder::H264_encode_close__
closed the camera!

camera driver name is : uvcvideo
camera device name is : USB2.0 Camera
camera bus information: usb-xhci-hcd.9.auto-1.2
Success in VIDIOC_S_FMT
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
Success in VIDIOC_G_FMT getSizeInfo()
fmt.fmt.pix.bytesperline:1280
format:YUYV
camera_width:640        ,camera_height:480
video_format:16  YUV 4:2:2

end open_camera
creater
pictureSize=460800
__DD_H264VideoFileServerMediaSubsession::startStream__
StreamOn success!
Segmentation fault (core dumped)
作者: sincsc    时间: 2021-4-26 10:58
楼主你好,我执行make的时候,找不到相关函数请问如何解决呢?

V4L2.cpp: In member function 'void V4L2FramedSource::convernt_to_OutputBuffer()':
V4L2.cpp:511:18: error: 'RgaCreate' was not declared in this scope
  rga = RgaCreate();
                  ^
V4L2.cpp:517:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->initCtx(rga);
       ^
V4L2.cpp:518:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->setRotate(rga, RGA_ROTATE_NONE);
       ^
V4L2.cpp:518:27: error: 'RGA_ROTATE_NONE' was not declared in this scope
  rga->ops->setRotate(rga, RGA_ROTATE_NONE);
                           ^
V4L2.cpp:519:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->setSrcFormat(rga, V4L2_PIX_FMT_YUYV, 640, 480);
       ^
V4L2.cpp:520:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->setDstFormat(rga, V4L2_PIX_FMT_NV12, 640, 480);
       ^
V4L2.cpp:528:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->setDstBufferPtr(rga, frame_nv12);
       ^
V4L2.cpp:529:7: error: 'class RockchipRga' has no member named 'ops'
  rga->ops->setSrcBufferPtr(rga, (unsigned char *) camera_buffers[index].start);
       ^
V4L2.cpp:531:17: error: 'class RockchipRga' has no member named 'ops'
  int ret = rga->ops->go(rga);
                 ^
V4L2.cpp:545:16: error: 'RgaDestroy' was not declared in this scope
  RgaDestroy(rga);
                ^
V4L2.cpp:482:12: warning: unused variable 'pPictureSrc' [-Wunused-variable]
  AVPicture pPictureSrc;
            ^
V4L2.cpp: In member function 'virtual void V4L2FramedSource::doGetNextFrame()':
V4L2.cpp:561:66: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]

作者: sincsc    时间: 2021-4-26 17:49
sincsc 发表于 2021-4-26 10:58
楼主你好,我执行make的时候,找不到相关函数请问如何解决呢?

V4L2.cpp: In member function 'void V4L2F ...

已解决,谢谢
作者: sincsc    时间: 2021-4-26 18:31
请教各位大佬,我的是ubuntu系统,更新了源,apt-get install rockchip-rga-dev可以安装rga,但是apt-get install rockchip-mpp-dev却找不到mmp包,有什么办法可以解决吗?
作者: jackson    时间: 2021-5-14 17:17
在测试RTSP推流时,VLC端画面只有上半部分显示出来,下半部分变成白色马赛克。其次在示例运行几十秒后出现segment fault:
[attach]1784[/attach]
从gdb调试看,是mmp出现了空指针操作?还麻烦问一下版主,你们几小时测试没有这个问题吗?我是在Debian10下进行的测试。

作者: zhangyuzyy    时间: 2021-6-24 09:37
在linux下用python可以调用吗?有文档吗?
作者: xw_wang2020    时间: 2021-7-9 13:23
zhangyuzyy 发表于 2021-6-24 09:37
在linux下用python可以调用吗?有文档吗?

有吗,同问
作者: xw_wang2020    时间: 2021-7-9 13:43
昆仑 发表于 2020-8-28 01:02
运行debian版本demo, vlc播放一会儿后中断,报错:
mpp[12923]: mpp_drm: os_allocator_drm_alloc handle_to_ ...

请问这个问题解决了吗
作者: xw_wang2020    时间: 2021-7-9 13:45
jackson 发表于 2021-5-14 17:17
在测试RTSP推流时,VLC端画面只有上半部分显示出来,下半部分变成白色马赛克。其次在示例运行几十秒后出现s ...

请问这个问题解决了吗

作者: 15992605143    时间: 2021-12-18 15:19
请问这个问题如何解决:
mpp[613]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[613]: rc: rc_init using rc impl default
mpp[613]: h264e_api_v2: h264e_proc_cfg MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
mpp[613]: h264e_api_v2: h264e_proc_cfg MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
mpp[613]: h264e_sps: set level to 2.2
mpp[613]: mpp_enc_v2: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
mpp[613]: mpp_enc_v2: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
mpp[613]: mpp_enc_v2: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[613]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[613]: mpp_buffer: mpp_buffer_create failed to create buffer with size 128
mpp[613]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_nal_size_table:259
作者: Bbjmonsoon    时间: 2021-12-21 22:01
学习...................
作者: btxc_cyy    时间: 2022-4-13 09:25
按教程更新源之后,安装rga出现以下的报错,请问怎么解决?
其他的软件都能成功安装。
root@debian10:/home/toybrick# apt install rockchip-rga-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
rockchip-rga-dev : Depends: rockchip-rga (= 2.2.0-4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@debian10:/home/toybrick#

作者: sl_168    时间: 2022-4-18 11:45
xw_wang2020 发表于 2021-7-9 13:43
请问这个问题解决了吗

同问,一样的错误
作者: sl_168    时间: 2022-4-18 11:46
昆仑 发表于 2020-8-28 01:02
运行debian版本demo, vlc播放一会儿后中断,报错:
mpp[12923]: mpp_drm: os_allocator_drm_alloc handle_to_ ...

请问问题解决了吗?
作者: dragonfly007    时间: 2022-6-10 15:20
demo的图像数据是从usb摄像头来的,如果是从RTSP网络摄像头采集数据代码需要如何修改呢?
作者: yizimi    时间: 2022-6-20 15:16
  1. end open_camera
  2. creater
  3. pictureSize=153600
  4. __DD_H264VideoFileServerMediaSubsession::startStream__
  5. StreamOn success!
  6. V4L2FramedSource::doGetNextFrame use 145
  7. mpi_enc_test start
  8. mpp[6538]: mpp_info: mpp version: unknown mpp version for missing VCS info
  9. mpp[6538]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
  10. mpp[6538]: mpp_enc: send header for codec/prep cfg change
  11. mpp[6538]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
  12. mpp[6538]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
  13. mpp[6538]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
  14. mpp[6538]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
  15. mpp[6538]: mpp_enc: send header for codec/prep cfg change
  16. mpp[6538]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
  17. mpp[6538]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
  18. encoded frame 0 size 146311
  19. encode max 1 framesmpi_enc_test success total frame 1 bps 35114640
  20. StreamEncoder::doGetNextFrame() use 194
  21. V4L2FramedSource::doGetNextFrame use 28
  22. mpi_enc_test start
  23. mpp[6538]: mpp_info: mpp version: unknown mpp version for missing VCS info
  24. mpp[6538]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
  25. mpp[6538]: mpp_enc: send header for codec/prep cfg change
  26. mpp[6538]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
  27. mpp[6538]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
  28. mpp[6538]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
  29. mpp[6538]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
  30. mpp[6538]: mpp_enc: send header for codec/prep cfg change
  31. mpp[6538]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
  32. mpp[6538]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
  33. Segmentation fault
复制代码

请问这个问题如何解决?
作者: richard    时间: 2022-10-11 17:57
请问这个支持多路摄像头输入嘛,如果想支持,改动大不大
作者: lfb6054    时间: 2023-3-27 16:20
yuys 发表于 2019-10-17 15:22
在局域网里,在PC 端口,通过opencv获取板子上的推流,PC上显示非常容易出现卡死。 ...

不一定,你是用的opencv老版本吧,没有编译ffmpeg吧
作者: Gang    时间: 2023-7-18 14:21
我下载了Debian10的代码,在板子上把摄像头改成了video5,在启动了VLC播放流以后,VLC的图像出不来,板子上狂打
V4L2FramedSource::doGetNextFrame use 144
mpi_enc_test start
mpp[3302]: mpp_rt: NOT found ion allocator
mpp[3302]: mpp_rt: found drm allocator
mpp[3302]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[3302]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
mpp[3302]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
mpp[3302]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
mpp[3302]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
encoded frame 0 size 200177
encode max 1 framesmpi_enc_test success total frame 1 bps 48042480
V4L2FramedSource::doGetNextFrame use 26 ,

到最后RTSPserver崩溃掉,
StreamEncoder::doGetNextFrame() use 50479
StreamEncoder::doGetNextFrame() use 50534
StreamEncoder::doGetNextFrame() use 50587
StreamEncoder::doGetNextFrame() use 50643
StreamEncoder::doGetNextFrame() use 50697
StreamEncoder::doGetNextFrame() use 50871
V4L2FramedSource::doGetNextFrame use 20
mpi_enc_test start
mpp[3302]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[3302]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
mpp[3302]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
mpp[3302]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
mpp[3302]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 460800
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_frame_buffer:293
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 460800
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_frame_buffer:293
mpp[3302]: mpp_buffer: mpp_buffer_get_fd invalid NULL input from hal_h264e_vepu2_get_task_v2
mpp[3302]: mpp_buffer: mpp_buffer_get_fd invalid NULL input from hal_h264e_vepu2_get_task_v2
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 128
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_nal_size_table:276
encoded frame 0 size 4941
encode max 1 framesmpi_enc_test success total frame 1 bps 1185840
StreamEncoder::doGetNextFrame() use 143
V4L2FramedSource::doGetNextFrame use 21
mpi_enc_test start
mpp[3302]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[3302]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
mpp[3302]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
mpp[3302]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
mpp[3302]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 48256
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 460800
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_frame_buffer:293
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 460800
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_frame_buffer:293
mpp[3302]: mpp_buffer: mpp_buffer_get_fd invalid NULL input from hal_h264e_vepu2_get_task_v2
mpp[3302]: mpp_buffer: mpp_buffer_get_fd invalid NULL input from hal_h264e_vepu2_get_task_v2
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 128
mpp[3302]: hal_h264e_vepu_v2: Assertion buf failed at h264e_vepu_buf_get_nal_size_table:276
encoded frame 0 size 4941
encode max 1 framesmpi_enc_test success total frame 1 bps 1185840
StreamEncoder::doGetNextFrame() use 135
V4L2FramedSource::doGetNextFrame use 20
mpi_enc_test start
mpp[3302]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[3302]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [640:480] stride [640:480]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: mode vbr bps [1500000:2000000:2500000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: MPP_ENC_SET_RC_CFG bps 1152000 [1080000 : 1224000] fps [30:30] gop 60
mpp[3302]: mpp_enc: send header for rc cfg change rc_mode/fps/gop
mpp[3302]: mpp_enc: mode cbr bps [1080000:1152000:1224000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[3302]: mpp_enc: send header for codec/prep cfg change
mpp[3302]: mpp_enc: Please use MPP_ENC_GET_HDR_SYNC instead of unsafe MPP_ENC_GET_EXTRA_INFO
mpp[3302]: mpp_enc: NOTE: MPP_ENC_GET_HDR_SYNC needs MppPacket input
mpp[3302]: mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp[3302]: mpp_buffer: mpp_buffer_create failed to create buffer with size 307200
mpp[3302]: mpp_enc: Assertion buffer failed at mpp_enc_check_pkt_buf:1147
mpp[3302]: mpp_buffer: mpp_buffer_get_ptr invalid NULL input from mpp_enc_check_pkt_buf
mpp[3302]: mpp_buffer: mpp_buffer_get_size invalid NULL input from mpp_enc_check_pkt_buf
mpp[3302]: mpp_enc: Assertion enc->pkt_buf failed at try_get_enc_task:1534
Segmentation fault
toybrick@debian10:~/IPCamera$



请问各位大神,我要怎么改才行呢?




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3