Firefly开源社区

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

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

997

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
997
发表于 2024-2-29 14:52:04        只看该作者  11#
本帖最后由 dengkx 于 2024-2-29 15:58 编辑
wuyq 发表于 2024-2-27 16:01
实际查看是rk3568pc-se板子;
第 1 步
  重新装机,安装py38环境
播不出来也有可能是h265参考帧太多,导致解码不出数据,改大解码模块buffer数量可以解决这个问题:
diff --git a/demo/demo.py b/demo/demo.py
index 7ce3580..e269d06 100644
--- a/demo/demo.py
+++ b/demo/demo.py
@@ -143,6 +143,7 @@ def main():
         input_para.v4l2Fmt == m.v4l2GetFmtByName("H265"):
         dec = m.ModuleMppDec()
         dec.setProductor(last_module)
+        dec.setBufferCount(20)
         ret = dec.init()
         if ret < 0:
             print("dec init failed")

回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-2-29 15:57:23        只看该作者  12#
本帖最后由 wuyq 于 2024-2-29 16:23 编辑
dengkx 发表于 2024-2-29 11:58
复现出问题,等几秒中按回车键退出,将退出的log过来看看。
或者不显示,使用 -e 0 -m out.mp4 编码保存 ...

目前尝试下述命令行,个人得出的结论:
① ffplay 花屏
② [-d 0][-x 1] -e 0 -m out.mp4;黑屏/绿屏,视频文件正常且有进度条
③ [-d 0][-x 1] -e 0 -f out.mp4;黑屏/绿屏,视频文件正常但无进度条
④ [-c 1] -b RGB24 -e 0 -m out.mp4;黑屏,视频文件也黑屏
需求:我需要回调函数能够返回正常的图片帧,然后用自研算法来分析图片~
麻烦看下下述具体流程:
-----20240229 14:00 启动下述命令,【现象】彩色花屏。按ctrl z or ctrl c退出。
  1. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# ffplay rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0
  2. [1] 2028
  3. root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# ffplay version 4.2.4-1ubuntu1.0firefly3 Copyright (c) 2003-2020 the FFmpeg developers
  4.   built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  5.   configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly3 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
  6.   libavutil      56. 31.100 / 56. 31.100
  7.   libavcodec     58. 54.100 / 58. 54.100
  8.   libavformat    58. 29.100 / 58. 29.100
  9.   libavdevice    58.  8.100 / 58.  8.100
  10.   libavfilter     7. 57.100 /  7. 57.100
  11.   libavresample   4.  0.  0 /  4.  0.  0
  12.   libswscale      5.  5.100 /  5.  5.100
  13.   libswresample   3.  5.100 /  3.  5.100
  14.   libpostproc    55.  5.100 / 55.  5.100
  15. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  16. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  17. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  18. Failed to initialize a hardware accelerated renderer: Couldn't find matching render driver
  19. Input #0, rtsp, from 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1':                                                
  20.   Metadata:
  21.     title           : Media Server
  22.   Duration: N/A, start: 0.000000, bitrate: N/A
  23.     Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080, 20 fps, 20 tbr, 90k tbn, 20 tbc
  24.     Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
  25. [hevc_rkmpp @ 0x7f8c05ba20] Decoder noticed an info change (1920x1080), format=0
  26. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  27. [swscaler @ 0x7f84004ae0] No accelerated colorspace conversion found from yuv420p to rgba.
  28. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  29. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  30. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  31. [rtsp @ 0x7f8c000ba0] max delay reached. need to consume packet/0   
  32. [rtsp @ 0x7f8c000ba0] RTP: missed 7 packets                                                                                               
  33. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  34.     Last message repeated 13 times                                                                                                        
  35. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0   
  36.     Last message repeated 25 times                                                                                                        
  37. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  38. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  39. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  40. ^C29.13 A-V:    nan fd=   2 aq=    7KB vq=  278KB sq=    0B f=0/0   
  41. ^C31.18 A-V:    nan fd=   2 aq=    7KB vq=  258KB sq=    0B f=0/0   an fd=   2 aq=    7KB vq=  281KB sq=    0B f=0/0   
  42. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  43. ^C33.69 A-V:    nan fd=   2 aq=    7KB vq=   59KB sq=    0B f=0/0   
  44. ^C33.98 A-V:    nan fd=   2 aq=    6KB vq=   63KB sq=    0B f=0/0   an fd=   2 aq=    7KB vq=   68KB sq=    0B f=0/0   
  45. ^C34.17 A-V:    nan fd=   2 aq=    7KB vq=  261KB sq=    0B f=0/0   an fd=   2 aq=    7KB vq=  299KB sq=    0B f=0/0   
  46. [rtsp @ 0x7f8c000ba0] max delay reached. need to consume packet/0   an fd=   2 aq=    7KB vq=  265KB sq=    0B f=0/0   
  47. [rtsp @ 0x7f8c000ba0] RTP: missed 32 packets                                                                                             
  48. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  49.     Last message repeated 6 times                                                                                                         
  50. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0   
  51.     Last message repeated 6 times                                                                                                         
  52. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0   
  53. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  54. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  55. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  56. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  57. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  58. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  59. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  60.     Last message repeated 1 times                                                                                                         
  61. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0   
  62. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  63. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  64. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  65. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  66. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  67. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  68. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  69. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  70. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  71. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  72. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  73. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  74. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  75. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  76. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  77. [hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0                                                                        
  78. XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
  79. free(): invalid pointer   2 aq=    7KB vq=    0KB sq=    0B f=0/0
复制代码

------20240229 14:22 启动下述命令,【现象】输出文件正常可以打开,也有时间进度条。按q退出。
  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 'out.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. 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. ==================Pipe===================
  12. ModuleRtspClient (H265 1920x1080)
  13.    |--->ModuleMppDec (NV12 1920x1080)
  14.            |--->ModuleMppEnc (H264 1920x1080)
  15.                    |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  16. wait...INFO: 10MppDecoder: getTimeoutSample: 0x54adc20 frame info changed 1 error 0 discard 0
  17. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  18. q
  19. ==================Summary================
  20. ModuleRtspClient (In Full: 0, Out Empty: 669)
  21.    |--->ModuleMppDec (In Full: 0, Out Empty: 623)
  22.            |--->ModuleMppEnc (In Full: 0, Out Empty: 644)
  23.                    |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

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

------20240229 14:29 启动下述命令,【现象】全屏黑屏,按1退出。
  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' --rtsp_transport '1' -o '1280*720' -d '0'
  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: 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: 0x33943cc0 frame info changed 1 error 0 discard 0
  20. 1
  21. ==================Summary================
  22. ModuleRtspClient (In Full: 0, Out Empty: 485)
  23.    |--->ModuleMppDec (In Full: 0, Out Empty: 463)
  24.            |--->ModuleDrmDisplay (In Full: 0, Out Empty: 0)

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

------20240229 14:37 启动下述命令,【现象】带框整个框绿屏,输出文件正常可以打开,也有时间进度条。按q退出。
  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' --rtsp_transport '1' -x '1' -e '0' -m 'out.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. 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: 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.            |--->ModuleRendererVideo (NV12 1920x1080)
  14.            |--->ModuleMppEnc (H264 1920x1080)
  15.                    |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  16. wait...arm_release_ver of this libmali is 'g2p0-01eac0', rk_so_ver is '4'.
  17. INFO: 10MppDecoder: getTimeoutSample: 0x33b1120 frame info changed 1 error 0 discard 0
  18. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  19. q
  20. ==================Summary================
  21. ModuleRtspClient (In Full: 0, Out Empty: 423)
  22.    |--->ModuleMppDec (In Full: 0, Out Empty: 775)
  23.            |--->ModuleRendererVideo (In Full: 1, Out Empty: 0)
  24.            |--->ModuleMppEnc (In Full: 0, Out Empty: 411)
  25.                    |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

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

------20240229 14:39 启动下述命令,【现象】全屏黑屏,输出文件正常可以打开,也有时间进度条。按q退出。
  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' --rtsp_transport '1' -d '0' -e '0' -m 'out.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. 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: 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.            |--->ModuleMppEnc (H264 1920x1080)
  17.                    |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  18. wait...rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  19. INFO: 16ModuleDrmDisplay: setupWindow: input NV12 0 0 1920 1080 2304 1088
  20. INFO: 16ModuleDrmDisplay: setupWindow: output NV12 0 0 1920 1080 1920 1080
  21. INFO: 10MppDecoder: getTimeoutSample: 0x19225120 frame info changed 1 error 0 discard 0
  22. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  23. q
  24. ==================Summary================
  25. ModuleRtspClient (In Full: 0, Out Empty: 224)
  26.    |--->ModuleMppDec (In Full: 0, Out Empty: 415)
  27.            |--->ModuleDrmDisplay (In Full: 0, Out Empty: 0)
  28.            |--->ModuleMppEnc (In Full: 0, Out Empty: 221)
  29.                    |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

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

------20240229 14:47 启动下述命令,【现象】全屏黑屏,输出文件也黑屏。按q退出。
  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' --rtsp_transport '1' -b 'BGR24' -c '1' -e '0' -m 'out.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. 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: 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 (BGR24 1920x1080)
  14.                    |--->`�n# (Unknow V4L2 Format 0x0)
  15.                    |--->ModuleMppEnc (H264 1920x1080)
  16.                            |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  17. wait...INFO: 10MppDecoder: getTimeoutSample: 0x23afc1a0 frame info changed 1 error 0 discard 0
  18. q
  19. ==================Summary================
  20. ModuleRtspClient (In Full: 0, Out Empty: 246)
  21.    |--->ModuleMppDec (In Full: 0, Out Empty: 213)
  22.            |--->ModuleRga (In Full: 6, Out Empty: 419)
  23.                    |--->��n# (In Full: 34, Out Empty: 0)
  24.                    |--->ModuleMppEnc (In Full: 4, Out Empty: 248)
  25.                            |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

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

------20240229 14:58 启动下述命令,【现象】带框整个框绿屏,输出文件正常可以打开,文件无进度条。
  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' --rtsp_transport '1' -x '1' -e '0' -f 'out.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. 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: 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.            |--->ModuleRendererVideo (NV12 1920x1080)
  14.            |--->ModuleMppEnc (H264 1920x1080)

  15. arm_release_ver of this libmali is 'g2p0-01eac0', rk_so_ver is '4'.
  16. wait...
  17. INFO: 10MppDecoder: getTimeoutSample: 0xea62160 frame info changed 1 error 0 discard 0
  18. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  19. q
  20. ==================Summary================
  21. ModuleRtspClient (In Full: 0, Out Empty: 224)
  22.    |--->ModuleMppDec (In Full: 0, Out Empty: 374)
  23.            |--->ModuleRendererVideo (In Full: 0, Out Empty: 0)
  24.            |--->ModuleMppEnc (In Full: 0, Out Empty: 0)
  25. INFO: 10RTSPClient: teardownMediaSession: teardown session success
复制代码

回复

使用道具 举报

997

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
997
发表于 2024-2-29 16:41:22        只看该作者  13#
本帖最后由 dengkx 于 2024-2-29 16:42 编辑
wuyq 发表于 2024-2-29 15:57
目前尝试下述命令行,个人得出的结论:
① ffplay 花屏
② [-d 0][-x 1] -e 0 -m out.mp4;黑屏/绿屏, ...

-f 参数是将源模块的输出的h265流保存成文件,你可以将这个文件拿到电脑使用ffplay或其他工具看能不能正常解码出画面。如果不能,说明rtsp服务端传过来的数据有问题,在你电脑上使用ffplay或其他工具看能不能正常拉流显示。
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-2-29 16:42:31        只看该作者  14#
dengkx 发表于 2024-2-29 14:52
播不出来也有可能是h265参考帧太多,导致解码不出数据,改大解码模块buffer数量可以解决这个问题:
diff - ...

尝试ffmedia_release的master分支
demo.py文件第146行新增
  1. dec.setBufferCount(20)
复制代码

使用
  1. python3 demo.py -i 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0' --rtsp_transport '1' -x '1'
复制代码
仍然绿屏~[-d 0]黑屏~无法展示
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-2-29 16:48:51        只看该作者  15#
dengkx 发表于 2024-2-29 16:41
-f 参数是将源模块的输出的h265流保存成文件,你可以将这个文件拿到电脑使用ffplay或其他工具看能不能正 ...

1、rtsp流,
win电脑,pycharm中使用cv2测试正常,命令行ffplay中测试正常;
盒子上,命令行ffplay花屏,pycharm中cv2测试正常;
2、引用中的命令输出的out.mp4,从板子中拿到win电脑使用迅雷影音 均能够播放 视频流 或者 黑屏~
回复

使用道具 举报

997

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
997
发表于 2024-2-29 16:54:59        只看该作者  16#
wuyq 发表于 2024-2-29 16:48
1、rtsp流,
win电脑,pycharm中使用cv2测试正常,命令行ffplay中测试正常;
盒子上,命令行ffplay花屏 ...

-f out.h265 将你保存的这个文件发出来
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-2-29 17:18:55        只看该作者  17#
dengkx 发表于 2024-2-29 16:54
-f out.h265 将你保存的这个文件发出来

------20240229 17:05 启动下述命令,【现象】out.h256正常输出2s左右。(20s左右的长视频也试过,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' -e '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. 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. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10004): INFO: ff_media: initiate: Rtp port(10004) already used the other rtp port
  9. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10006): INFO: ff_media: initiate: Rtp port(10006) already used the other rtp port
  10. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10008): INFO: ff_media: initiate: Rtp port(10008) already used the other rtp port
  11. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10010): INFO: ff_media: initiate: Rtp port(10010) already used the other rtp port
  12. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  13. INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
  14. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
  15. ==================Pipe===================
  16. ModuleRtspClient (H265 1920x1080)
  17.    |--->ModuleMppDec (NV12 1920x1080)
  18.            |--->ModuleMppEnc (H264 1920x1080)

  19. wait...INFO: 10MppDecoder: getTimeoutSample: 0xf7836a0 frame info changed 1 error 0 discard 0
  20. INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
  21. q
  22. ==================Summary================
  23. ModuleRtspClient (In Full: 0, Out Empty: 423)
  24.    |--->ModuleMppDec (In Full: 0, Out Empty: 389)
  25.            |--->ModuleMppEnc (In Full: 0, Out Empty: 0)

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

我使用本potPlayer打开了out.h256,正常播放,也有进度条,您需要文件的话 私信的手机号添加我下好友,我发给您(目前我无法上传附件合片,页面中的上传组件乱码)
回复

使用道具 举报

997

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
997
发表于 2024-2-29 17:33:06        只看该作者  18#
wuyq 发表于 2024-2-29 17:18
------20240229 17:05 启动下述命令,【现象】out.h256正常输出2s左右。(20s左右的长视频也试过,win中 ...

我意思是说在你显示黑屏时将那次输出的数据发给我。
-d 0 -f out.h265, 观察到显示异常将本次保存的out.h265发过来
回复

使用道具 举报

98

积分

0

威望

0

贡献

技术小白

积分
98
发表于 2024-2-29 17:47:09        只看该作者  19#
本帖最后由 wuyq 于 2024-3-1 09:17 编辑
dengkx 发表于 2024-2-29 17:33
我意思是说在你显示黑屏时将那次输出的数据发给我。
-d 0 -f out.h265, 观察到显示异常将本次保存的out. ...

-e 0 -f out.h265 是正常的,无不正常现象;
使用以下命令会出现异常~
------20240229 17:44 输出黑屏
  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' --rtsp_transport '1' -b 'BGR24' -c '1' -e '0' -m '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. 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. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10004): INFO: ff_media: initiate: Rtp port(10004) already used the other rtp port
  9. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10006): INFO: ff_media: initiate: Rtp port(10006) already used the other rtp port
  10. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10008): INFO: ff_media: initiate: Rtp port(10008) already used the other rtp port
  11. ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10010): INFO: ff_media: initiate: Rtp port(10010) already used the other rtp port
  12. INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
  13. rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
  14. ==================Pipe===================
  15. ModuleRtspClient (H265 1920x1080)
  16.    |--->ModuleMppDec (NV12 1920x1080)
  17.            |--->ModuleRga (BGR24 1920x1080)
  18.                    |--->@&#141280;(Unknow V4L2 Format 0x0)
  19.                    |--->ModuleMppEnc (H264 1920x1080)
  20.                            |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

  21. wait...INFO: 10MppDecoder: getTimeoutSample: 0x21663020 frame info changed 1 error 0 discard 0
  22. qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 185, resource id: 0, major code: 140 (Unknown), minor code: 20
  23. q
  24. ==================Summary================
  25. ModuleRtspClient (In Full: 0, Out Empty: 23)
  26.    |--->ModuleMppDec (In Full: 62, Out Empty: 1)
  27.            |--->ModuleRga (In Full: 55, Out Empty: 53)
  28.                    |--->&#653224;In Full: 53, Out Empty: 0)
  29.                    |--->ModuleMppEnc (In Full: 7, Out Empty: 58)
  30.                            |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

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

已通过您的同事 转您新的不行的视频~
回复

使用道具 举报

997

积分

0

威望

0

贡献

技术大神

Rank: 3Rank: 3

积分
997
发表于 2024-2-29 18:49:14        只看该作者  20#
wuyq 发表于 2024-2-29 17:47
-d 0 -f out.h265 是正常的,无不正常现象;
使用以下命令会出现异常~
------20240229 17:44 输出黑屏
...

-d 0 -f out.h265 正常说明拉流解码正常。
编码模块只能处理NV12的数据-b 转换成BGR格式就不要用-e编码保存了,除非自己再添加个RAG模块将BGR格式数据再转回NV12数据给编码模块。
./demo.py -i rtsp://xxx -d 0 -e 0 -m out.mp4
运行这条命令如果显示正常并且封装的out.mp4也可以正常播放,说明拉流解码编码封装都没有问题。
回复

使用道具 举报

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

本版积分规则

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