chenll 发表于 2023-7-31 11:08:56

FFMedia中回调函数问题

在使用官方的FFMedia python demo中cv_display.module = last_module.addExternalConsumer("Cv2Display", cv_display, cv2_extcall_back)在cv2_extcall_back回调函数中,打印日志发现没有效果
firefly@firefly:~/project/ffmedia_release/demo$ python3 ./demo.py -i rtsp://admin:a88888888@192.168.10.10:554/Streaming/Channels/1 --rtsp_transport 1 -b RGB24 -c 1
Firefly FFMedia: v2.1.1
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.10.10:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 1280 720, ws hs: 1280 720, format: H264
mpp: mpp_rt: NOT found ion allocator
mpp: mpp_rt: found drm allocator
mpp: mpp_info: mpp version: 8a85dc5d author: Herman Chen   2022-03-14 : Fix stuck on reset async mode encoder
librga fail to get driver version! Legacy mode will be enabled.

rga_api version 1.7.0_
======================1====================================
wait...INFO: 10MppDecoder: getTimeoutSample: 0x1aeea80 frame info changed 1 error 0 discard 0
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail
ERROR: 9ModuleRga: work: Consume failed
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail
ERROR: 9ModuleRga: work: Consume failed
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail
ERROR: 9ModuleRga: work: Consume failed
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail
ERROR: 9ModuleRga: work: Consume failed
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail
ERROR: 9ModuleRga: work: Consume failed
RgaBlit(1387) RGA_BLIT fail: Bad address
RgaBlit(1388) RGA_BLIT fail: Bad address
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
fd-vir-phy-hnd-format
rect
f-blend-size-rotation-col-log-mmu
This output the user patamaters when rga call blit fail



代码如下
def cv2_extcall_back(obj, VideoBuffer):
    print('=========================2========================')
    vb = m.VideoBuffer.from_base(VideoBuffer)
    if obj.sync is not None:
      delay = obj.sync.updateVideo(vb.getPUstimestamp(), 0)
      if delay > 0:
            time.sleep(delay/1000000)
    data = vb.getActiveData()
    try:
      img = data.reshape((vb.getImagePara().vstride, vb.getImagePara().hstride, 3))
      print("------------------------")
    except ValueError:
      print("Invalid image resolution!")
      resolution = find_two_numbers(data.size//3, vb.getImagePara().hstride, vb.getImagePara().vstride)
      print("Try the recommended resolution: -o {}x{}".format(resolution, resolution))
      exit(-1)
    for i in range(obj.count):
      cv2.imshow(obj.name + str(i), img)
    cv2.waitKey(1)




chenll 发表于 2023-7-31 11:12:28

elif args.cvdisplay > 0:
      if not cv2_enable:
            print("Run 'pip3 install opencv-python' to install opencv")
            return 1
      if output_para.v4l2Fmt != m.v4l2GetFmtByName("RGB24"):
            print("Output image format is not 'RGB24', Use the '-b RGB24' option to specify image format.")
            return 1
      print('======================1====================================')
      cv_display = Cv2Display("Cv2Display", None, sync, args.cvdisplay)
      cv_display.module = last_module.addExternalConsumer("Cv2Display", cv_display, cv2_extcall_back)

dengkx 发表于 2023-7-31 11:30:13

rga转换图像格式失败了,还没到回调执行。默认的分支会在rk356x和3588验证, rv1126、rk3399等还要另推分支

chenll 发表于 2023-7-31 11:32:19

dengkx 发表于 2023-7-31 11:30
rga转换图像格式失败了,还没到回调执行。默认的分支会在rk356x和3588验证, rv1126、rk3399等还要另推分支

我在gitlab 上面只看到了 两个分支,请问目前这种情况我需要怎么处理

dengkx 发表于 2023-7-31 14:21:40

chenll 发表于 2023-7-31 11:32
我在gitlab 上面只看到了 两个分支,请问目前这种情况我需要怎么处理

我还没推这两个分支,后续会推这两个分支

chenll 发表于 2023-7-31 14:23:52

dengkx 发表于 2023-7-31 14:21
我还没推这两个分支,后续会推这两个分支

请问大概需要多久,如果时间久的话,我就换一块3588的
页: [1]
查看完整版本: FFMedia中回调函数问题