rv1126 mpp硬件编解码

rv1126 mpp硬件编解码 2023-11-17 09:10:43 2334

一.mpp支持信息

支持的编解码类型及像素类型:

mpp[569]: mpi: mpp coding type support list:
mpp[569]: mpi: type: dec id 0 coding: mpeg2            id 2
mpp[569]: mpi: type: dec id 0 coding: mpeg4            id 4
mpp[569]: mpi: type: dec id 0 coding: h.263            id 3
mpp[569]: mpi: type: dec id 0 coding: h.264/AVC        id 7
mpp[569]: mpi: type: dec id 0 coding: h.265/HEVC       id 16777220
mpp[569]: mpi: type: dec id 0 coding: vp8              id 9
mpp[569]: mpi: type: dec id 0 coding: VP9              id 10
mpp[569]: mpi: type: dec id 0 coding: avs+             id 16777221
mpp[569]: mpi: type: dec id 0 coding: jpeg             id 8
mpp[569]: mpi: type: enc id 1 coding: h.264/AVC        id 7
mpp[569]: mpi: type: enc id 1 coding: jpeg             id 8
mpp[569]: mpi: type: enc id 1 coding: h265             id 16777220
mpp[569]: mpi: type: enc id 1 coding: vp8              id 9
mpp[569]: mpi: mpp color support list:
mpp[569]: mpi: color: id 0     0x00000 YUV420SP,      NV12
mpp[569]: mpi: color: id 1     0x00001 YUV420SP-10bit
mpp[569]: mpi: color: id 2     0x00002 YUV422SP,      NV24
mpp[569]: mpi: color: id 3     0x00003 YUV422SP-10bit
mpp[569]: mpi: color: id 4     0x00004 YUV420P,       I420
mpp[569]: mpi: color: id 5     0x00005 YUV420SP,      NV21
mpp[569]: mpi: color: id 6     0x00006 YUV422P,       422P
mpp[569]: mpi: color: id 7     0x00007 YUV422SP,      NV42
mpp[569]: mpi: color: id 8     0x00008 YUV422-YUYV,   YUY2
mpp[569]: mpi: color: id 10    0x0000a YUV422-UYVY,   UYVY
mpp[569]: mpi: color: id 12    0x0000c YUV400-Y8,     Y800
mpp[569]: mpi: color: id 65536 0x10000 RGB565
mpp[569]: mpi: color: id 65537 0x10001 BGR565
mpp[569]: mpi: color: id 65538 0x10002 RGB555
mpp[569]: mpi: color: id 65539 0x10003 BGR555
mpp[569]: mpi: color: id 65542 0x10006 RGB888
mpp[569]: mpi: color: id 65543 0x10007 BGR888
mpp[569]: mpi: color: id 65546 0x1000a ARGB8888
mpp[569]: mpi: color: id 65547 0x1000b ABGR8888
mpp[569]: mpi: color: id 65548 0x1000c BGRA8888
mpp[569]: mpi: color: id 65549 0x1000d RGBA8888

二.H264硬件编解码耗时

通过修改环境变量,可以查看硬件编解码的耗时,下面以1080p H264的编解码过程,来看下耗时情况(注意,如果没有接串口调试工具,而是通过ssh连接的设备,默认看不到系统信息,需要通过dmesg命令来看,dmesg -c可以查看信息并清除):

编解码调试信息打开命令:

echo 0x0100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug

1.编码H264耗时:

命令:

mpi_enc_test -w 1920 -h 1080 -t 7 -i test-420sp-nv12-40i.yuv -o ./test-420sp-nv12.h264 -n 40 -r 25

耗时:

[30880.160290] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8780 us
[30880.192603] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8740 us
[30880.221705] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 9008 us
[30880.251454] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8780 us
[30880.282631] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8711 us
[30880.314301] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8769 us
[30880.345558] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8776 us
[30880.377452] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8726 us
[30880.402128] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8727 us
[30880.429073] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8777 us
[30880.454536] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8733 us
[30880.480960] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8711 us
[30880.506083] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8725 us
[30880.534846] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8832 us
[30880.564863] ffbb0000.rkvenc: pid: 3452, session: 813f8467, time: 8784 us

2.解码H264耗时:

[31193.790609] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4106 us
[31193.805727] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4247 us
[31193.848580] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4081 us
[31193.910752] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4146 us
[31193.926870] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4298 us
[31193.963760] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4161 us
[31194.030271] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4230 us
[31194.046113] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4135 us
[31194.083370] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4251 us
[31194.149656] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4443 us
[31194.164945] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4151 us
[31194.211401] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4134 us
[31194.267779] ffb80000.rkvdec: pid: 917, session: 797c23e6, time: 4255 us

三.jpeg硬件编解码耗时

通过修改环境变量,可以查看硬件编解码的耗时,下面以1080p jpeg/mjpeg的编解码过程,来看下耗时情况(注意,如果没有接串口调试工具,而是通过ssh连接的设备,默认看不到系统信息,需要通过dmesg命令来看,dmesg -c可以查看信息并清除),另外注意,jpeg有图片质量之分,所以不同的图片,即使都是1080p的,编解码耗时也有可能不同。

编解码调试信息打开命令:

echo 0x0100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug

1.编码jpeg

命令:

mpi_enc_test -w 1920 -h 1080 -t 8 -i test-rgba-rgb32-40i.yuv -o ./zl-rgba.jpg -n 1 -r 25 -f 65549

耗时:

[56764.844590] ffb90000.vepu: pid: 2942, session: 545d95af, time: 14713 us

2.解码jpeg

命令:

mpi_dec_test -i zl-rgba.jpg -t 8 -w 1920 -h 1080 -o zl-rgba.yuv

耗时:

[57461.346905] ffb90400.vdpu: pid: 1929, session: 9bf49e81, time: 14311 us

三.mpp编码demo的命令

mpi_enc_test编码demo支持的参数如下:

mpp[569]: mpi_enc_utils: usage: mpi_enc_test [options]
mpp[569]: utils: -i  input_file         input bitstream file
mpp[569]: utils: -o  output_file        output bitstream file,
mpp[569]: utils: -w  width              the width of input picture
mpp[569]: utils: -h  height             the height of input picture
mpp[569]: utils: -f  format             the format of input picture
mpp[569]: utils: -t  type               output stream coding type
mpp[569]: utils: -n  max frame number   max encoding frame number
mpp[569]: utils: -g  gop_mode           gop reference mode
mpp[569]: utils: -d  debug              debug flag
mpp[569]: utils: -b  bps target:min:max set tareget bps
mpp[569]: utils: -r  in/output fps      set input and output frame rate
mpp[569]: utils: -l  loop count         loop encoding times for each frame

测试命令及log:

1.yuv编码h264测试:

[root@RV1126_RV1109:/userdata/share/rv1126-test/jpgout]# mpi_enc_test -w 1920 -h 1080 -t 7 -i test-bgra-rgb32-40i.yuv -o ./zl-rgba.h264 -n 30 -r 25 -f 655
49
mpp[2554]: mpi_enc_utils: cmd parse result:
mpp[2554]: mpi_enc_utils: input  file name: test-bgra-rgb32-40i.yuv
mpp[2554]: mpi_enc_utils: output file name: ./zl-rgba.h264
mpp[2554]: mpi_enc_utils: width      : 1920
mpp[2554]: mpi_enc_utils: height     : 1080
mpp[2554]: mpi_enc_utils: format     : 65549
mpp[2554]: mpi_enc_utils: type       : 7
mpp[2554]: mpi_enc_test: mpi_enc_test start
mpp[2554]: mpp_rt: NOT found ion allocator
mpp[2554]: mpp_rt: found drm allocator
mpp[2554]: mpp_info: mpp version: 92a7c2a4 author: daijh         2021-04-21 debian: fix patch not found bug
mpp[2554]: mpi_enc_test: 0x34ac0 mpi_enc_test encoder test start w 1920 h 1080 type 7
mpp[2554]: mpp_enc: MPP_ENC_SET_RC_CFG bps 6480000 [405000 : 6885000] fps [25:25] gop 50
mpp[2554]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1920:1080] stride [7680:1080]
mpp[2554]: mpp_enc: send header for set cfg change input/format
mpp[2554]: mpp_enc: mode cbr bps [405000:6480000:6885000] fps fix [25/1] -> fix [25/1] gop i [50] v [0]
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 0    size 38562   qp 24
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 1    size 1642    qp 30
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 2    size 1074    qp 30
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 3    size 1432    qp 29
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 4    size 2195    qp 28
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 5    size 303     qp 28
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 6    size 2188    qp 27
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 7    size 743     qp 27
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 8    size 2613    qp 26
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 9    size 1607    qp 26
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 10   size 2697    qp 26
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 11   size 4996    qp 25
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 12   size 3295    qp 25
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 13   size 7893    qp 24
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 14   size 6211    qp 24
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 15   size 11542   qp 22
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 16   size 9468    qp 22
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 17   size 18304   qp 21
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 18   size 10459   qp 21
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 19   size 13349   qp 20
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 20   size 20215   qp 19
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 21   size 19179   qp 19
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 22   size 33357   qp 18
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 23   size 16599   qp 18
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 24   size 16874   qp 17
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 25   size 30334   qp 17
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 26   size 30475   qp 16
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 27   size 18434   qp 16
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 28   size 34099   qp 17
mpp[2554]: mpi_enc_test: 0x34ac0 encoded frame 29   size 28654   qp 16
mpp[2554]: mpi_enc_test: 0x34ac0 encode max 30 frames
mpp[2554]: mpi_enc_test: 0x34ac0 mpi_enc_test success total frame 30 bps 2591953
[root@RV1126_RV1109:/userdata/share/rv1126-test/jpgout]#

2.yuv编码jpg测试:

[root@RV1126_RV1109:/userdata/share/rv1126-test/jpgout]# mpi_enc_test -w 1920 -h 1080 -t 8 -i test-rgba-rgb32-40i.yuv -o ./zl-rgba.jpg -n 1 -r 25 -f 65549
mpp[2952]: mpi_enc_utils: cmd parse result:
mpp[2952]: mpi_enc_utils: input  file name: test-rgba-rgb32-40i.yuv
mpp[2952]: mpi_enc_utils: output file name: ./zl-rgba.jpg
mpp[2952]: mpi_enc_utils: width      : 1920
mpp[2952]: mpi_enc_utils: height     : 1080
mpp[2952]: mpi_enc_utils: format     : 65549
mpp[2952]: mpi_enc_utils: type       : 8
mpp[2952]: mpi_enc_test: mpi_enc_test start
mpp[2952]: mpp_rt: NOT found ion allocator
mpp[2952]: mpp_rt: found drm allocator
mpp[2952]: mpp_info: mpp version: 92a7c2a4 author: daijh         2021-04-21 debian: fix patch not found bug
mpp[2952]: mpi_enc_test: 0x34ac0 mpi_enc_test encoder test start w 1920 h 1080 type 8
mpp[2952]: mpp_enc: MPP_ENC_SET_RC_CFG bps 6480000 [405000 : 6885000] fps [25:25] gop 50
mpp[2952]: mpi_enc_test: 0x34ac0 encoded frame 0    size 142615
mpp[2952]: mpi_enc_test: 0x34ac0 encode max 1 frames
mpp[2952]: mpi_enc_test: 0x34ac0 mpi_enc_test success total frame 1 bps 28523000
[root@RV1126_RV1109:/userdata/share/rv1126-test/jpgout]#

四.mpp解码demo的命令

mpi_dec_test解码demo支持的参数如下:

[root@RV1126_RV1109:/userdata/share/rv1126-test/ffmpeg-demo-dir]# mpi_dec_test
mpp[1462]: mpi_dec_utils: usage: mpi_dec_test [options]
mpp[1462]: utils: -i  input_file        input bitstream file
mpp[1462]: utils: -o  output_file       output bitstream file,
mpp[1462]: utils: -c  ops_file          input operation config file
mpp[1462]: utils: -w  width             the width of input bitstream
mpp[1462]: utils: -h  height            the height of input bitstream
mpp[1462]: utils: -t  type              input stream coding type
mpp[1462]: utils: -f  format            output frame format type
mpp[1462]: utils: -d  debug             debug flag
mpp[1462]: utils: -x  timeout           output timeout interval
mpp[1462]: utils: -n  frame_number      max output frame number
mpp[1462]: utils: -s  instance_nb       number of instances
mpp[1462]: utils: -(null)  (null)               (null)
mpp[1462]: mpi: mpp coding type support list:
mpp[1462]: mpi: type: dec id 0 coding: mpeg2            id 2
mpp[1462]: mpi: type: dec id 0 coding: mpeg4            id 4
mpp[1462]: mpi: type: dec id 0 coding: h.263            id 3
mpp[1462]: mpi: type: dec id 0 coding: h.264/AVC        id 7
mpp[1462]: mpi: type: dec id 0 coding: h.265/HEVC       id 16777220
mpp[1462]: mpi: type: dec id 0 coding: vp8              id 9
mpp[1462]: mpi: type: dec id 0 coding: VP9              id 10
mpp[1462]: mpi: type: dec id 0 coding: avs+             id 16777221
mpp[1462]: mpi: type: dec id 0 coding: jpeg             id 8
mpp[1462]: mpi: type: enc id 1 coding: h.264/AVC        id 7
mpp[1462]: mpi: type: enc id 1 coding: jpeg             id 8
mpp[1462]: mpi: type: enc id 1 coding: h265             id 16777220
mpp[1462]: mpi: type: enc id 1 coding: vp8              id 9
[root@RV1126_RV1109:/userdata/share/rv1126-test/ffmpeg-demo-dir]#

五.查看每一路码流的参数

查看每一路码流的编码参数信息,命令:

cat /proc/mpp_service/session_summary

信息截图:

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包 2 3 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区