ffmedia无法正常调用

固件类型:官方提供的固件
固件文件名称:rk356x_linux_release_v1.3.0b_20221213_split_dir
固件下载地址:Firefly | 让科技更简单,让生活更智能
Log日志:error.rar

调用ffmedia直接报错,缺少文件:
import ff_pymedia as m
ImportError: libfdk-aac.so.1: cannot open shared object file: No such file or directory

尝试了2.0,2.1和2.2版,都不行,在rk3588主板上能正常使用ffmedia
tchip_askquestions
error.rar (178 Bytes)

看下demo/Readme.md的环境配置安装对应依赖包

dengkx 发表于 2023-11-15 17:29
看下demo/Readme.md的环境配置安装对应依赖包

重新安装之后可以使用ffmedia读书取rtsp流,虽然图像的宽带比摄像头上的设定的多8像素,但是最起码能可以看到画面,重启设备之后,跑一模一样的demo,显示的画面就全黑了,而且输出的图像宽度还是多了8

dengkx 发表于 2023-11-15 17:29
看下demo/Readme.md的环境配置安装对应依赖包

参照【看下demo/Readme.md的环境配置安装对应依赖包】执行完成;
目前现象:
使用【./demo rtsp://admin:firefly123@168.168.2.143 --rtsp_transport tcp -o 1280x720 -d 0 -r 90 -s 】修改了具体流信息,rk3568pc盒子重启后,命令行使用su,执行上述命令,目前打印输出

Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.216:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 3840 2160, ws hs: 3840 2160, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 10MppDecoder: getTimeoutSample: 0x26419580 frame info changed 1 error 0 discard 0
[0 0 0 ... 0 0 0]
==================Pipe===================
ModuleRtspClient (H265 3840x2160)
   |--->ModuleMppDec (NV12 3840x2160)
           |--->ModuleRga (BGR24 1280x720)
                   |--->�a (Unknow V4L2 Format 0x0)
wait...[0 0 0 ... 0 0 0]

其中【[0 0 0 … 0 0 0]】为cv2_extcall_back函数下【print(str(MediaBuffer.getActiveData()))】结果,黑屏。请大神指导~

本帖最后由 wuyq 于 2024-2-23 09:33 编辑

wuyq 发表于 2024-2-22 20:00
参照【看下demo/Readme.md的环境配置安装对应依赖包】执行完成;
目前现象:
使用【./demo rtsp://admi …

继续在rk3568pc盒子中使用pycharm打开demo.py文件,修改【print(str(MediaBuffer.getActiveData()))】输出位置,并使用pycharm启动代码,命令参数不变,输出结果

Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.216:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 3840 2160, ws hs: 3840 2160, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 10MppDecoder: getTimeoutSample: 0x39143580 frame info changed 1 error 0 discard 0
[147   0 171 ...   0 252   6]
[151 152 151 ... 142 140 133]
==================Pipe===================
ModuleRtspClient (H265 3840x2160)
   |--->ModuleMppDec (NV12 3840x2160)
           |--->ModuleRga (BGR24 1280x720)
                   |--->���8 (Unknow V4L2 Format 0x0)
[172 173 172 ... 142 140 133]

cv2展示的内容正常,流也正常。
并且直接使用命令行也能正常输出了~~~

然后重启rk3568pc,直接启动pycharm,再次尝试,输出结果

Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.216:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 3840 2160, ws hs: 3840 2160, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 10MppDecoder: getTimeoutSample: 0x26419580 frame info changed 1 error 0 discard 0
[0 0 0 ... 0 0 0]
==================Pipe===================
ModuleRtspClient (H265 3840x2160)
   |--->ModuleMppDec (NV12 3840x2160)
           |--->ModuleRga (BGR24 1280x720)
                   |--->�a (Unknow V4L2 Format 0x0)
wait...[0 0 0 ... 0 0 0]

又又又又黑屏了。请大神指导~~~
并且直接使用命令行也无法正常输出了~~~

wuyq 发表于 2024-2-22 20:03
继续在rk3568pc盒子中使用pycharm打开demo.py文件,修改【print(str(MediaBuffer.getActiveData()))】输 …

你python不应该运行demo.py吗?看你运行的命令是c++的demo。
有问题提供复现条件,方便我这边复现。比如使用的命令、修改差异等等

本帖最后由 wuyq 于 2024-2-27 16:19 编辑

dengkx 发表于 2024-2-23 11:33
你python不应该运行demo.py吗?看你运行的命令是c++的demo。
有问题提供复现条件,方便我这边复现。比如 …

实际查看是rk3568pc-se板子;
第 1 步
重新装机,安装py38环境
第 2 步
按照ffmedia_release/demo/Readme.md,安装依赖库
第 3 步
全局安装ffmedia_release/dist/ff_pymedia-2.2.3-cp38-cp38-linux_aarch64.whl
第 4 步
将ffmedia_release/demo/demo.py放置rk3568pc-se板子xxx目录中
第 5 步
执行命令“python3 demo.py -i rtsp://xxx:xxx@192.168.8.216:554/h264/ch1/main/av_stream -o 1280x720 -x 1”
现象【1】
正常启动,输出摄像头流正常;

Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.216:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 3840 2160, ws hs: 3840 2160, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 10MppDecoder: getTimeoutSample: 0x26419580 frame info changed 1 error 0 discard 0
==================Pipe===================
ModuleRtspClient (H265 3840x2160)
   |--->ModuleMppDec (NV12 3840x2160)
           |--->ModuleRga (BGR24 1280x720)
                   |--->�a (Unknow V4L2 Format 0x0)

第 6 步
重启rk3568pc-se,可视化界面reboot
第 7 步
执行上述第 5 步操作
现象【2】
正常启动,输出摄像头流异常,为绿屏或者黑屏,无数据;

Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.216:554
INFO: 16ModuleRtspClient: init: rtsp para w h: 3840 2160, ws hs: 3840 2160, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 10MppDecoder: getTimeoutSample: 0x26419580 frame info changed 1 error 0 discard 0
==================Pipe===================
ModuleRtspClient (H265 3840x2160)
   |--->ModuleMppDec (NV12 3840x2160)
           |--->ModuleRga (BGR24 1280x720)
                   |--->�a (Unknow V4L2 Format 0x0)

控制台打印内容与现象【1】一致。
请大神指点~~~

wuyq 发表于 2024-2-27 16:01
实际查看是rk3568pc-se板子;
第 1 步
重新装机,安装py38环境

应该是环境问题,不要使用-x 1 使用-d 0 显示看看

本帖最后由 wuyq 于 2024-2-29 11:43 编辑

dengkx 发表于 2024-2-28 17:36
应该是环境问题,不要使用-x 1 使用-d 0 显示看看

使用-d 0后仍然是黑屏,是否可以提供安装环境参数
系统安装包文件
py38安装包文件
按照您这边提供的资源,我这边刷机再试试。
机器是【Firefly RK3568-ROC-PC-SE HDMI (Linux)】

wuyq 发表于 2024-2-29 11:29
使用-d 0后仍然是黑屏,是否可以提供安装环境参数
系统安装包文件
py38安装包文件

复现出问题,等几秒中按回车键退出,将退出的log过来看看。
或者不显示,使用 -e 0 -m out.mp4 编码保存文件,用ffplay播放或其他工具播放看正不正常?

本帖最后由 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")
    

本帖最后由 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退出。

root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# ffplay rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1&subtype=0
[1] 2028
root@firefly:/home/ap/cetccity/wuyiqi/ffmediaTest# ffplay version 4.2.4-1ubuntu1.0firefly3 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  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
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
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.)
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.)
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.)
Failed to initialize a hardware accelerated renderer: Couldn't find matching render driver
Input #0, rtsp, from 'rtsp://admin:js123456@192.168.8.213:554/cam/realmonitor?channel=1':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080, 20 fps, 20 tbr, 90k tbn, 20 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
[hevc_rkmpp @ 0x7f8c05ba20] Decoder noticed an info change (1920x1080), format=0
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
[swscaler @ 0x7f84004ae0] No accelerated colorspace conversion found from yuv420p to rgba.
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.)
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.)
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.)
[rtsp @ 0x7f8c000ba0] max delay reached. need to consume packet/0
[rtsp @ 0x7f8c000ba0] RTP: missed 7 packets
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
    Last message repeated 13 times
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
    Last message repeated 25 times
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.)
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.)
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.)
^C29.13 A-V:    nan fd=   2 aq=    7KB vq=  278KB sq=    0B f=0/0
^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
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.)
^C33.69 A-V:    nan fd=   2 aq=    7KB vq=   59KB sq=    0B f=0/0
^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
^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
[rtsp @ 0x7f8c000ba0] max delay reached. need to consume packet/0   an fd=   2 aq=    7KB vq=  265KB sq=    0B f=0/0
[rtsp @ 0x7f8c000ba0] RTP: missed 32 packets
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
    Last message repeated 6 times
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
    Last message repeated 6 times
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
    Last message repeated 1 times
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
[hevc_rkmpp @ 0x7f8c05ba20] Received a errinfo frame.    0B f=0/0
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.)
free(): invalid pointer   2 aq=    7KB vq=    0KB sq=    0B f=0/0

------20240229 14:22 启动下述命令,【现象】输出文件正常可以打开,也有时间进度条。按q退出。

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleMppEnc (H264 1920x1080)
                   |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

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

INFO: 10RTSPClient: teardownMediaSession: teardown session success

------20240229 14:29 启动下述命令,【现象】全屏黑屏,按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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
INFO: 15DrmDisplayPlane: setupDisplayDevice: 0 0
INFO: 15DrmDisplayPlane: setupDisplayDevice: conn_id = 150 enc_id = 149 crtc_id = 71
INFO: 15DrmDisplayPlane: setup: plane_id = 101
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleDrmDisplay (NV12 1920x1080)

wait...rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
INFO: 16ModuleDrmDisplay: setupWindow: input NV12 0 0 1920 1080 2304 1088
INFO: 16ModuleDrmDisplay: setupWindow: output NV12 0 0 1920 1080 1920 1080
INFO: 10MppDecoder: getTimeoutSample: 0x33943cc0 frame info changed 1 error 0 discard 0
1
==================Summary================
ModuleRtspClient (In Full: 0, Out Empty: 485)
   |--->ModuleMppDec (In Full: 0, Out Empty: 463)
           |--->ModuleDrmDisplay (In Full: 0, Out Empty: 0)

INFO: 10RTSPClient: teardownMediaSession: teardown session success

------20240229 14:37 启动下述命令,【现象】带框整个框绿屏,输出文件正常可以打开,也有时间进度条。按q退出。

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleRendererVideo (NV12 1920x1080)
           |--->ModuleMppEnc (H264 1920x1080)
                   |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

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

INFO: 10RTSPClient: teardownMediaSession: teardown session success

------20240229 14:39 启动下述命令,【现象】全屏黑屏,输出文件正常可以打开,也有时间进度条。按q退出。

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
INFO: 15DrmDisplayPlane: setupDisplayDevice: 0 0
INFO: 15DrmDisplayPlane: setupDisplayDevice: conn_id = 150 enc_id = 149 crtc_id = 71
INFO: 15DrmDisplayPlane: setup: plane_id = 101
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleDrmDisplay (NV12 1920x1080)
           |--->ModuleMppEnc (H264 1920x1080)
                   |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

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

INFO: 10RTSPClient: teardownMediaSession: teardown session success

------20240229 14:47 启动下述命令,【现象】全屏黑屏,输出文件也黑屏。按q退出。

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleRga (BGR24 1920x1080)
                   |--->`�n# (Unknow V4L2 Format 0x0)
                   |--->ModuleMppEnc (H264 1920x1080)
                           |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

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

INFO: 10RTSPClient: teardownMediaSession: teardown session success

------20240229 14:58 启动下述命令,【现象】带框整个框绿屏,输出文件正常可以打开,文件无进度条。

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleRendererVideo (NV12 1920x1080)
           |--->ModuleMppEnc (H264 1920x1080)

arm_release_ver of this libmali is 'g2p0-01eac0', rk_so_ver is '4'.
wait...
INFO: 10MppDecoder: getTimeoutSample: 0xea62160 frame info changed 1 error 0 discard 0
INFO: 10MppEncoder: putWithBuffers: Input frame para is changed, redo init
q
==================Summary================
ModuleRtspClient (In Full: 0, Out Empty: 224)
   |--->ModuleMppDec (In Full: 0, Out Empty: 374)
           |--->ModuleRendererVideo (In Full: 0, Out Empty: 0)
           |--->ModuleMppEnc (In Full: 0, Out Empty: 0)
INFO: 10RTSPClient: teardownMediaSession: teardown session success

本帖最后由 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或其他工具看能不能正常拉流显示。

dengkx 发表于 2024-2-29 14:52
播不出来也有可能是h265参考帧太多,导致解码不出数据,改大解码模块buffer数量可以解决这个问题:
diff - …

尝试ffmedia_release的master分支
demo.py文件第146行新增

dec.setBufferCount(20)

使用

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]黑屏~无法展示

dengkx 发表于 2024-2-29 16:41
-f 参数是将源模块的输出的h265流保存成文件,你可以将这个文件拿到电脑使用ffplay或其他工具看能不能正 …

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

wuyq 发表于 2024-2-29 16:48
1、rtsp流,
win电脑,pycharm中使用cv2测试正常,命令行ffplay中测试正常;
盒子上,命令行ffplay花屏 …

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

dengkx 发表于 2024-2-29 16:54
-f out.h265 将你保存的这个文件发出来

------20240229 17:05 启动下述命令,【现象】out.h256正常输出2s左右。(20s左右的长视频也试过,win中正常播放)

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10004): INFO: ff_media: initiate: Rtp port(10004) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10006): INFO: ff_media: initiate: Rtp port(10006) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10008): INFO: ff_media: initiate: Rtp port(10008) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10010): INFO: ff_media: initiate: Rtp port(10010) already used the other rtp port
INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
INFO: ff_media: RTPSource: RTPSock current buffer size is(425984)
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleMppEnc (H264 1920x1080)

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

INFO: 10RTSPClient: teardownMediaSession: teardown session success

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

wuyq 发表于 2024-2-29 17:18
------20240229 17:05 启动下述命令,【现象】out.h256正常输出2s左右。(20s左右的长视频也试过,win中 …

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

本帖最后由 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 输出黑屏

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'
Firefly FFMedia: v2.2.3
input source is a rtsp url
INFO: ff_media: connectToServer: connected to server 192.168.8.213:554
WARN: ff_media: sendOptionsCmd: cannot handle OPTIONS response: RTSP/1.0 401 Unauthorized
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10000): INFO: ff_media: initiate: Rtp port(10000) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10002): INFO: ff_media: initiate: Rtp port(10002) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10004): INFO: ff_media: initiate: Rtp port(10004) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10006): INFO: ff_media: initiate: Rtp port(10006) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10008): INFO: ff_media: initiate: Rtp port(10008) already used the other rtp port
ERROR: ff_media: CheckUdpPort: [CheckUdpPort] bind() error (port number: 10010): INFO: ff_media: initiate: Rtp port(10010) already used the other rtp port
INFO: 16ModuleRtspClient: init: rtsp para w h: 1920 1080, ws hs: 1920 1080, format: H265
rga_api version 1.3.0_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
==================Pipe===================
ModuleRtspClient (H265 1920x1080)
   |--->ModuleMppDec (NV12 1920x1080)
           |--->ModuleRga (BGR24 1920x1080)
                   |--->@𢟠(Unknow V4L2 Format 0x0)
                   |--->ModuleMppEnc (H264 1920x1080)
                           |--->ModuleFileWriter (Unknow V4L2 Format 0x0)

wait...INFO: 10MppDecoder: getTimeoutSample: 0x21663020 frame info changed 1 error 0 discard 0
qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 185, resource id: 0, major code: 140 (Unknown), minor code: 20
q
==================Summary================
ModuleRtspClient (In Full: 0, Out Empty: 23)
   |--->ModuleMppDec (In Full: 62, Out Empty: 1)
           |--->ModuleRga (In Full: 55, Out Empty: 53)
                   |--->򟞨In Full: 53, Out Empty: 0)
                   |--->ModuleMppEnc (In Full: 7, Out Empty: 58)
                           |--->ModuleFileWriter (In Full: 0, Out Empty: 0)

INFO: 10RTSPClient: teardownMediaSession: teardown session success

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

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也可以正常播放,说明拉流解码编码封装都没有问题。