VIM3 camera H264编解码问题

使用VIM3预览帧率能达到30fps,如果APK取camera数据H264本地编解码 HAL的帧率会由30帧降为15fps。有人遇到这种问题吗?

3-29 11:06:15.928 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:15.929 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:15.929 3225 3371 E MesonHwc: too many layers need LEGACY_VIDEO_PLANE, discard.
03-29 11:06:15.949 3219 6236 V MIPISensor: Sensor capturing buffer 1: stream 1, 1920 x 1080, format 11, stride 1920, buf 0xa7209d38, img 0xa08e9000
03-29 11:06:15.973 3219 6236 V MIPISensor: captureNewImage:buffer size=2
03-29 11:06:15.973 3219 6236 V MIPISensor: Sensor capturing buffer 0: stream 1, 1920 x 1080, format 23, stride 1920, buf 0xa7209e70, img 0xa0001000
03-29 11:06:15.985 3303 6280 D gralloc : ERR: am_gralloc_set_omx_video_type: is a empty function
03-29 11:06:15.987 3303 6334 I FASTGX_RC: base qp:22, bu_cnt:0
03-29 11:06:15.995 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:15.996 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:15.996 3225 3371 E MesonHwc: too many layers need LEGACY_VIDEO_PLANE, discard.
03-29 11:06:16.010 3219 6236 V MIPISensor: Sensor capturing buffer 1: stream 1, 1920 x 1080, format 11, stride 1920, buf 0xa7209ff0, img 0x9f421000
03-29 11:06:16.033 3219 6236 V MIPISensor: captureNewImage:buffer size=2
03-29 11:06:16.033 3219 6236 V MIPISensor: Sensor capturing buffer 0: stream 1, 1920 x 1080, format 23, stride 1920, buf 0xa7209f90, img 0x9f129000
03-29 11:06:16.046 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:16.046 3225 3371 W gralloc : omx buffer: descriptorInfo->width:1920 descriptorInfo->height:1080
03-29 11:06:16.046 3225 3371 E MesonHwc: too many layers need LEGACY_VIDEO_PLANE, discard.
03-29 11:06:16.056 3303 6280 D gralloc : ERR: am_gralloc_set_omx_video_type: is a empty function
03-29 11:06:16.063 3303 6334 I FASTGX_RC: base qp:22, bu_cnt:0
03-29 11:06:16.074 3219 6236 V MIPISensor: Sensor capturing buffer 1: stream 1, 1920 x 1080, format 11, stride 1920, buf 0xa7209db0, img 0x9fd09000
03-29 11:06:16.099 3219 6236 V MIPISensor: captureNewImage:buffer size=2
03-29 11:06:16.100 3219 6236 V MIPISensor: Sensor capturing buffer 0: stream 1, 1920 x 1080, format 23, stride 1920, buf 0xa7209f18, img 0x9fa11000

<7>[ 354.093457@4] vdec_init, vf_provider_name = vdec.h264.00
<4>[ 354.100713@5] allocating phys 0x638c0000, size 20480k, wq:e7802800.
<4>[ 354.101480@5] amvenc_avc memory config success, buff start:0x638c0000, size is 0x1400000, wq:e7802800.
<6>[ 354.103760@3] vdec->port_flag=0x102, port_flag=0x10b
<4>[ 354.116206@5] avc init – rows_per_slice: 68, wq: e7802800.
<4>[ 354.121306@5] avc init as mode 0, wq: e7802800.
<3>[ 354.125800@5] hwenc: AMVENC_AVC_IOC_CONFIG_INIT: w:0, h:0
<3>[ 354.131153@5] hwenc: AMVENC_AVC_IOC_CONFIG_INIT, wq->pic.color_space=0x0
<7>[ 354.138058@5] the vdec clock on, ref cnt: 2
<4>[ 354.148390@5] init avc encode. microcode 0, ret=0, wq:e7802800.
<7>[ 354.421611@5] 0: AV_SCRATCH_1 = 811fe078, AV_SCRATCH_2 8000
<7>[ 354.421767@5] 0: frame_mbs_only_flag 1, crop_bottom 4, frame_height 1080,
<7>[ 354.421771@5] 0: mb_height 68,crop_right 0, frame_width 1920, mb_width 120
<7>[ 354.421774@5] 0: mb height/widht/total: 44/78/1fe0 level_idc 28 max_ref_num 1
<7>[ 354.421777@5] 0: restriction_flag=0, max_dec_frame_buffering=0, reorder_pic_num=5
<7>[ 354.421781@5] 0: vh264_set_params active_buf_spec_num 11 reorder_pic_num 5 collocate_buf_num 5
<7>[ 354.497457@3] 0: num_ref_frames change from 0 to 1
<6>[ 354.504759@5] PPMGRVPP: info: tb first frame type: 0
<6>[ 354.506125@5] PPMGRVPP: info: tb cma memory 675f5000, size 18000, item 8
<6>[ 354.510959@5] DI: di_wr_cue_int:finish
<6>[ 354.514510@5] di: di_init_buf -S
<7>[ 354.517703@5] DI: di_init_buf:cma alloc req time: 54356 ms
<6>[ 354.517721@5] di: di_init_buf -E
<7>[ 354.521038@5] di_patch_post_update_mc_sw:0x0->0x2
<6>[ 354.531797@0] di_cma_alloc:alloc 10 buffer use 16 ms(54356~54372)
<6>[ 354.536044@0] videosync_open
<6>[ 354.536114@0] omx need drop 0
<6>[ 354.536973@3] pre_de_buf_config:54376ms 1th source change: 0x0/0/0/0=>0x9000/1920/1080/0
<6>[ 354.591095@1] videosync_open
<6>[ 354.646433@5] DI:6534 disable post.
<7>[ 358.046724@1] DI: DI: tasklet schedule cost 12ms.
<3>[ 382.116093@2] IRQRatio___ERR.irq:19 ratio:35
<3>[ 382.116157@2] t_isr:352 t_total:1000, cnt:0
<3>[ 393.119624@5] IRQRatio___ERR.irq:19 ratio:35
<3>[ 393.119680@5] t_isr:352 t_total:1000, cnt:22016
<3>[ 395.122892@3] IRQRatio___ERR.irq:19 ratio:35
<3>[ 395.122921@3] t_isr:355 t_total:1000, cnt:22390
<3>[ 396.126132@4] IRQRatio___ERR.irq:19 ratio:35
<3>[ 396.126163@4] t_isr:356 t_total:1000, cnt:22573
<3>[ 399.129713@2] IRQRatio___ERR.irq:19 ratio:35
<3>[ 399.129752@2] t_isr:355 t_total:1000, cnt:22447
<3>[ 406.133165@4] IRQRatio___ERR.irq:19 ratio:36
<3>[ 406.133199@4] t_isr:363 t_total:1000, cnt:1
<7>[ 408.586915@2] DI: DI: tasklet schedule cost 12ms.
<3>[ 414.136256@2] IRQRatio___ERR.irq:19 ratio:35
<3>[ 414.136258@5] IRQRatio___ERR.irq:19 ratio:35
<3>[ 414.136260@5] t_isr:350 t_total:1000, cnt:21996
<3>[ 414.136262@4] IRQRatio___ERR.irq:19 ratio:35
<3>[ 414.136272@4] t_isr:350 t_total:1000, cnt:0
<3>[ 414.152239@2] t_isr:350 t_total:1000, cnt:251
<3>[ 428.156978@3] IRQRatio___ERR.irq:19 ratio:35

走android标准预览取数据做H264编解码

khadas同事能帮忙回复一下这个问题吗?谢谢。。。。

@terry @goenjoy @jasonl 帮忙看看。

提供完整的上层log, 并把你的实例贴一下,谢谢

链接:https://pan.baidu.com/s/1xjzAQ7rgLz4kUpwM1fSjug
提取码:q1di
附上本地H264编解码实例 log以及测试APK demo!

APK应该没啥毛病 在其他平台验证过没问题 只是编解码器不同而已

你是用了我们的mipi摄像头吗?还是usb摄像头?

目前是接了mipi camera 接USB camera 也一样

你好 你们那边有确认到这个问题吗 :smiley: :smiley: :smiley: :smiley:

@Terry 你好 有什么思路提供一下吗?感谢

抱歉,目前还在看这个问题,如果有结果会回复你

USB这路编解码帧率四分之1画面还能接近30帧;在USB编解码的情况下 增加一路mipi预览或者MIPI这路直接H264编解码 帧率稳定后大概20帧左右 与datesheet说明的编解码性能相差有点大

@seekdream1990 百度网盘过期了,麻烦重新发下

链接:https://pan.baidu.com/s/1DmtIeC7a27rYjHhnj_wurw
提取码:nul5

我这边目前两个修改有所改善:
1.MIPI这路也采用GE2D方式拷贝
2.USB取消OMX 采用软件进行MIPEG转NV21
两路同时预览稳定在28帧 左右 但是其中一路编解码 就掉下去了。

@seekdream1990 你说vim3 预览帧率30 fps ,使用你发的app-debug.apk 这个apk 测试的吗,我这边测试没到30 ,只有23,mipi 摄像头测试的

描述预览30帧是只是一路预览情况下 我的apk不是一路预览 目前来看只有一路预览的情况才能到达30

用自带的相机预览一路 能到30帧 :grinning:

你是用最新的20210128 固件测试的?我这边只用usb 摄像头,用你的apk 测试可以接近30fps,同时接mipi 和usb ,都变成了15左右,是这样子的把? 现在你是要同时接usb 和mipi 都能到30fps ?