Firefly开源社区

打印 上一主题 下一主题

[应用开发] FFMedia中回调函数问题

112

积分

0

威望

0

贡献

技术小白

积分
112

FFMedia中回调函数问题

发表于 2023-7-31 11:08:56      浏览:1418 | 回复:5        打印      只看该作者   [复制链接] 楼主
问题描述及复现步骤:
在使用官方的FFMedia python demo中
  1. cv_display.module = last_module.addExternalConsumer("Cv2Display", cv_display, cv2_extcall_back)
复制代码
在cv2_extcall_back回调函数中,打印日志发现没有效果
  1. 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
  2. Firefly FFMedia: v2.1.1
  3. input source is a rtsp url
  4. INFO: ff_media: connectToServer: connected to server 192.168.10.10:554
  5. INFO: 16ModuleRtspClient: init: rtsp para w h: 1280 720, ws hs: 1280 720, format: H264
  6. mpp[1411]: mpp_rt: NOT found ion allocator
  7. mpp[1411]: mpp_rt: found drm allocator
  8. mpp[1411]: mpp_info: mpp version: 8a85dc5d author: Herman Chen   2022-03-14 [mpp_enc]: Fix stuck on reset async mode encoder
  9. librga fail to get driver version! Legacy mode will be enabled.

  10. rga_api version 1.7.0_[1]
  11. ======================1====================================
  12. wait...INFO: 10MppDecoder: getTimeoutSample: 0x1aeea80 frame info changed 1 error 0 discard 0
  13. RgaBlit(1387) RGA_BLIT fail: Bad address
  14. RgaBlit(1388) RGA_BLIT fail: Bad address
  15. fd-vir-phy-hnd-format[18, (nil), (nil), (nil), 0]
  16. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  17. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  18. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  19. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  20. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  21. This output the user patamaters when rga call blit fail
  22. ERROR: 9ModuleRga: work: Consume failed
  23. RgaBlit(1387) RGA_BLIT fail: Bad address
  24. RgaBlit(1388) RGA_BLIT fail: Bad address
  25. fd-vir-phy-hnd-format[19, (nil), (nil), (nil), 0]
  26. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  27. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  28. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  29. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  30. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  31. This output the user patamaters when rga call blit fail
  32. ERROR: 9ModuleRga: work: Consume failed
  33. RgaBlit(1387) RGA_BLIT fail: Bad address
  34. RgaBlit(1388) RGA_BLIT fail: Bad address
  35. fd-vir-phy-hnd-format[20, (nil), (nil), (nil), 0]
  36. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  37. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  38. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  39. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  40. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  41. This output the user patamaters when rga call blit fail
  42. ERROR: 9ModuleRga: work: Consume failed
  43. RgaBlit(1387) RGA_BLIT fail: Bad address
  44. RgaBlit(1388) RGA_BLIT fail: Bad address
  45. fd-vir-phy-hnd-format[21, (nil), (nil), (nil), 0]
  46. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  47. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  48. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  49. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  50. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  51. This output the user patamaters when rga call blit fail
  52. ERROR: 9ModuleRga: work: Consume failed
  53. RgaBlit(1387) RGA_BLIT fail: Bad address
  54. RgaBlit(1388) RGA_BLIT fail: Bad address
  55. fd-vir-phy-hnd-format[22, (nil), (nil), (nil), 0]
  56. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  57. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  58. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  59. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  60. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  61. This output the user patamaters when rga call blit fail
  62. ERROR: 9ModuleRga: work: Consume failed
  63. RgaBlit(1387) RGA_BLIT fail: Bad address
  64. RgaBlit(1388) RGA_BLIT fail: Bad address
  65. fd-vir-phy-hnd-format[23, (nil), (nil), (nil), 0]
  66. rect[0, 0, 1280, 720, 1280, 720, 2560, 0]
  67. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  68. fd-vir-phy-hnd-format[35, (nil), (nil), (nil), 0]
  69. rect[0, 0, 1280, 720, 1280, 720, 1792, 0]
  70. f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
  71. This output the user patamaters when rga call blit fail
复制代码




代码如下
  1. def cv2_extcall_back(obj, VideoBuffer):
  2.     print('=========================2========================')
  3.     vb = m.VideoBuffer.from_base(VideoBuffer)
  4.     if obj.sync is not None:
  5.         delay = obj.sync.updateVideo(vb.getPUstimestamp(), 0)
  6.         if delay > 0:
  7.             time.sleep(delay/1000000)
  8.     data = vb.getActiveData()
  9.     try:
  10.         img = data.reshape((vb.getImagePara().vstride, vb.getImagePara().hstride, 3))
  11.         print("------------------------")
  12.     except ValueError:
  13.         print("Invalid image resolution!")
  14.         resolution = find_two_numbers(data.size//3, vb.getImagePara().hstride, vb.getImagePara().vstride)
  15.         print("Try the recommended resolution: -o {}x{}".format(resolution[0], resolution[1]))
  16.         exit(-1)
  17.     for i in range(obj.count):
  18.         cv2.imshow(obj.name + str(i), img)
  19.     cv2.waitKey(1)
复制代码




1.zip

516 Bytes, 下载次数: 0, 下载积分: 灯泡 -1 , 经验 -1

回复

使用道具 举报

112

积分

0

威望

0

贡献

技术小白

积分
112
发表于 2023-7-31 11:12:28        只看该作者  沙发
  1. elif args.cvdisplay > 0:
  2.         if not cv2_enable:
  3.             print("Run 'pip3 install opencv-python' to install opencv")
  4.             return 1
  5.         if output_para.v4l2Fmt != m.v4l2GetFmtByName("RGB24"):
  6.             print("Output image format is not 'RGB24', Use the '-b RGB24' option to specify image format.")
  7.             return 1
  8.         print('======================1====================================')
  9.         cv_display = Cv2Display("Cv2Display", None, sync, args.cvdisplay)
  10.         cv_display.module = last_module.addExternalConsumer("Cv2Display", cv_display, cv2_extcall_back)
复制代码
回复

使用道具 举报

813

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

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

使用道具 举报

112

积分

0

威望

0

贡献

技术小白

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

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

使用道具 举报

813

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
813
发表于 2023-7-31 14:21:40        只看该作者  5#
chenll 发表于 2023-7-31 11:32
我在gitlab 上面只看到了 两个分支,请问目前这种情况我需要怎么处理

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

使用道具 举报

112

积分

0

威望

0

贡献

技术小白

积分
112
发表于 2023-7-31 14:23:52        只看该作者  6#
dengkx 发表于 2023-7-31 14:21
我还没推这两个分支,后续会推这两个分支

请问大概需要多久,如果时间久的话,我就换一块3588的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表