Firefly开源社区

12
发表新贴
打印 上一主题 下一主题

[应用开发] ffmedia无法正常调用

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-1 09:58:36      11#
本帖最后由 wuyq 于 2024-3-1 14:02 编辑
dengkx 发表于 2024-3-1 09:43
你可以按照我提供的操作来吗?
-d 0 -f out.h265
看到显示黑屏后等几秒退出,你就可以用你win软件播放 ...

按照您说的,操作如下~
-----20240301 09:50 【现象】-d 0 盒子上全屏黑屏,-f out.h256 win环境播放正常。
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0' -d '0' -f 'out.h265'
  2. Firefly FFMedia: v2.2.3
  3. input source is a rtsp url
  4. INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
  5. WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
  6. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  7. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  8. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
  9. INFO: 15DrmDisplayPlane: setupDisplayDevice: 0 0
  10. INFO: 15DrmDisplayPlane: setupDisplayDevice: conn_id = 150 enc_id = 149 crtc_id = 71
  11. INFO: 15DrmDisplayPlane: setup: plane_id = 101
  12. ==================Pipe===================
  13. ModuleRtspClient (H265 1920x1080)
  14.    |--->ModuleMppDec (NV12 1920x1080)
  15.            |--->ModuleDrmDisplay (NV12 1920x1080)

  16. wait...rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  17. INFO: 16ModuleDrmDisplay: setupWindow: input NV12 0 0 1920 1080 2304 1088
  18. INFO: 16ModuleDrmDisplay: setupWindow: output NV12 0 0 1920 1080 1920 1080
  19. INFO: 10MppDecoder: getTimeoutSample: 0x2e49f6a0 frame info changed 1 error 0 discard 0
  20. q
  21. ==================Summary================
  22. ModuleRtspClient (In Full: 0, Out Empty: 109)
  23.    |--->ModuleMppDec (In Full: 0, Out Empty: 103)
  24.            |--->ModuleDrmDisplay (In Full: 0, Out Empty: 0)

  25. INFO: 10RTSPClient: teardownMediaSession: teardown session success
复制代码

这边的需求是希望通过demo.py中的cv2_extcall_bac方法,
获取第54行的img = data.reshape((vb.getImagePara().vstride, vb.getImagePara().hstride, 3)),
然后对img进行图像算法处理。
然后目前尝试过-c 1无效,然后排错就出现了-d 0、-x 1显示不行问题~~~


回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-3 09:45:03      12#
wuyq 发表于 2024-3-1 09:58
按照您说的,操作如下~
-----20240301 09:50 【现象】-d 0 盒子上全屏黑屏,-f out.h256 win环境播放正 ...

该【现象】-d 0 盒子上全屏黑屏,-f out.h256 win环境播放正常。
是否可以认为是ffmedia屏幕输出有问题,生成的out.h256是正常的?
打印cv2_extcall_bac方法中str(MediaBuffer.getActiveData())是[0,0,0,....,0]。
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-4 11:33:26      13#
本帖最后由 wuyq 于 2024-3-4 11:35 编辑
dengkx 发表于 2024-3-4 10:34
这问题看着像是rga的问题。再试试这两个命令, -i输入本地视频文件也行:
./demo.py -i rtsp://xxxx - e  ...

按照要求测试结果:
~~结论~~
① rtsp mp4文件播放正常。
② 找了2段mp4本地文件,执行后 新的mp4文件均绿屏。

~~详细命令行~~
------20240304 11:20 out1.mp4【打开正常】
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0' -e '0' -m 'out1.mp4'
  2. Firefly FFMedia: v2.2.3
  3. input source is a rtsp url
  4. INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
  5. WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
  6. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  7. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  8. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
  9. ==================Pipe===================
  10. ModuleRtspClient (H265 1920x1080)
  11.    |--->ModuleMppDec (NV12 1920x1080)
  12.            |--->ModuleMppEnc (H264 1920x1080)
  13.                    |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  14. wait...INFO: 10MppDecoder: getTimeoutSample: 0x5ea22a0 frame info changed 1 error 0 discard 0
  15. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  16. q
  17. ==================Summary================
  18. ModuleRtspClient (In Full: 0, Out Empty: 479)
  19.    |--->ModuleMppDec (In Full: 0, Out Empty: 458)
  20.            |--->ModuleMppEnc (In Full: 0, Out Empty: 461)
  21.                    |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

  22. INFO: 10RTSPClient: teardownMediaSession: teardown session success
复制代码

------20240304 11:22 out2.mp4【打开不正常】
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'yanhuo.mp4' -o '1280x720' -e '0' -m 'out2.mp4'
  2. Firefly FFMedia: v2.2.3
  3. input source is a regular file.
  4. INFO: 16ModuleFileReader: init: Get Video Resolution( 2560 x 1436 )
  5. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  6. ==================Pipe===================
  7. ModuleFileReader (H264 2560x1436)
  8.    |--->ModuleMppDec (NV12 2560x1436)
  9.            |--->ModuleRga (NV12 1280x720)
  10.                    |--->ModuleMppEnc (H264 1280x720)
  11.                            |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  12. wait...INFO: 10MppDecoder: getTimeoutSample: 0x8ba7d20 frame info changed 1 error 0 discard 0
  13. INFO: 16ModuleFileReader: work: Produce EOS
  14. ERROR: 16ModuleFileWriter: work: wait for productor ModuleMppEnc timeout
  15. q
  16. ==================Summary================
  17. ModuleFileReader (In Full: 0, Out Empty: 49)
  18.    |--->ModuleMppDec (In Full: 1720, Out Empty: 8)
  19.            |--->ModuleRga (In Full: 200, Out Empty: 508)
  20.                    |--->ModuleMppEnc (In Full: 14, Out Empty: 863)
  21.                            |--->ModuleFileWriter (In Full: 0, Out Empty: 0)
复制代码

------20240304 11:26 out3.mp4【打开不正常】
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'mj.mp4' -o '1280x720' -e '0' -m 'out3.mp4'
  2. Firefly FFMedia: v2.2.3
  3. input source is a regular file.
  4. INFO: 16ModuleFileReader: init: Get Video Resolution( 540 x 960 )
  5. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  6. ==================Pipe===================
  7. ModuleFileReader (H264 540x960)
  8.    |--->ModuleMppDec (NV12 540x960)
  9.            |--->ModuleRga (NV12 1280x720)
  10.                    |--->ModuleMppEnc (H264 1280x720)
  11.                            |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  12. wait...INFO: 10MppDecoder: getTimeoutSample: 0x4f998e0 frame info changed 1 error 0 discard 0
  13. INFO: 16ModuleFileReader: work: Produce EOS
  14. ERROR: 16ModuleFileWriter: work: wait for productor ModuleMppEnc timeout
  15. q
  16. ==================Summary================
  17. ModuleFileReader (In Full: 0, Out Empty: 434)
  18.    |--->ModuleMppDec (In Full: 355, Out Empty: 7)
  19.            |--->ModuleRga (In Full: 212, Out Empty: 7)
  20.                    |--->ModuleMppEnc (In Full: 339, Out Empty: 347)
  21.                            |--->ModuleFileWriter (In Full: 0, Out Empty: 0)
复制代码
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-4 13:41:51      14#
本帖最后由 wuyq 于 2024-3-4 13:53 编辑
dengkx 发表于 2024-3-4 11:41
第二条命令也可以测下rtsp,不过大概知道问题了,是rga模块无法正常运行,可以更新最新的发布的固件测试 ...

目前我们的盒子版本是rk3568pc-se。可以使用以下固件地址吗?【https://www.t-firefly.com/doc/download/180.html -> 固件 -> Ubuntu ->Ubuntu20.04 -> Public -> ROC-RK3568-PC-SE_Ubuntu20.04-r3108_v1.3.2g_240111.7z】
回复测试情况~
------20240304 13:35 out4.mp4【打开不正常】
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0' -o '1280x720' -e '0' -m 'out4.mp4'
  2. Firefly FFMedia: v2.2.3
  3. input source is a rtsp url
  4. INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
  5. WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
  6. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  7. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  8. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
  9. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  10. ==================Pipe===================
  11. ModuleRtspClient (H265 1920x1080)
  12.    |--->ModuleMppDec (NV12 1920x1080)
  13.            |--->ModuleRga (NV12 1280x720)
  14.                    |--->ModuleMppEnc (H264 1280x720)
  15.                            |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  16. wait...INFO: 10MppDecoder: getTimeoutSample: 0x2b00f360 frame info changed 1 error 0 discard 0
  17. q
  18. ==================Summary================
  19. ModuleRtspClient (In Full: 0, Out Empty: 309)
  20.    |--->ModuleMppDec (In Full: 0, Out Empty: 296)
  21.            |--->ModuleRga (In Full: 0, Out Empty: 295)
  22.                    |--->ModuleMppEnc (In Full: 0, Out Empty: 296)
  23.                            |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

  24. INFO: 10RTSPClient: teardownMediaSession: teardown session success
复制代码

回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-4 15:49:23      15#
本帖最后由 wuyq 于 2024-3-4 15:59 编辑
dengkx 发表于 2024-3-4 13:53
https://www.t-firefly.com/doc/download/180.html
可以在这个页面选择你要下载的固件下载

最新的发布的固件测试下,我找到的是一下固件版本
固件版本ROC-RK3568-PC-SE_Ubuntu20.04-r3108_v1.3.2g_240111.7z
此固件自带python38
参照ffmedia_release/demo/readme.md安装apt组件
运行以下命令出现的情况~
总结
-e 0 -f out.h256 文件在win环境播放正常
-e 0 -o 1280*720 -x 1 绿屏

------20240304 15:00 【现象】绿屏无法展示
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# python3 demo.py -i 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0' -e '0' -o '1280*720' -x '1'
  2. Firefly FFMedia: v2.2.3
  3. input source is a rtsp url                                                                                                                                                                  
  4. INFO: ff_media: connectToServer: connected to server 192.168.8.213:554                                                                                                                       
  5. WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized                                                                                                   
  6. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port                                   
  7. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port                                   
  8. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)                                                                                                                           
  9. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)                                                                                                                           
  10. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265                                                                                                     
  11. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)                                                                                                                  
  12. ==================Pipe===================                                                                                      
复制代码







回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-5 17:18:24      16#

目前测试了5块 roc-rk3568-pc-se板子,均有同样现象的问题~麻烦有新进展这边也回复下~
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-3-5 19:37:38      17#
本帖最后由 wuyq 于 2024-3-7 09:20 编辑
dengkx 发表于 2024-3-5 17:42
如果均是这种现象,那基本不是板子的问题。如果你有任何修改保存修改,回退,再测试。
或者你可以使用ff ...

使用ffplay,尝试以下几种播放形式(win播放均正常的视频)
/usr/local/test.mp4--新窗口花屏
rtsp流---新窗口花屏,H265
rtsp输出.mp4---新窗口花屏,H264
小视频.mp4---无新窗口弹出,H264
电脑录屏.mp4---新窗口花屏,H264

----------

目前所有测试均采用./demo.py + 命令参数,文件本身未做任何代码处理。

----------

请问你们复现问题了吗?需要我这边邮寄板子吗?急~~~




回复

使用道具 举报

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

本版积分规则

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