Firefly开源社区

打印 上一主题 下一主题

[技术讨论] 运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流

59

积分

0

威望

0

贡献

技术小白

积分
59

运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流

发表于 2024-6-5 16:11:03      浏览:1202 | 回复:8        打印      只看该作者   [复制链接] 楼主
  • 固件类型: 官方提供的固件
  • 固件文件名称: rv1126
  • 固件下载地址: 百度
  • Log日志: test_rtsp.zip
问题描述及复现步骤:
运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流,程序会卡在Started playing session...
完整的日志如下:
[root@MiWiFi-RA69-srv:/demo/bin]# ./rkmedia_rtspget_vdec_test rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_s
tream
media get entity by name: stream_cif_dvp_id0 is null
media get entity by name: stream_cif_dvp_id1 is null
media get entity by name: stream_cif_dvp_id2 is null
media get entity by name: stream_cif_dvp_id3 is null
media get entity by name: rkcif-lvds-subdev is null
media get entity by name: rkcif-lite-lvds-subdev is null
media get entity by name: stream_cif is null
media get entity by name: rkcif-dvp-sof is null
media get entity by name: rkisp-mpfbc-subdev is null
media get entity by name: rkisp_dmapath is null
media get entity by name: rockchip-mipi-dphy-rx is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_lite_mipi_lvds is null
media get entity by name: rkisp-mpfbc-subdev is null
media get entity by name: rkisp_dmapath is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_mipi_lvds is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_lite_mipi_lvds is null
media get entity by name: rkcif_mipi_lvds is null
register factory : rkmpp
register factory : rkmpp
register factory : live555_rtsp_server
register factory : video_enc
register factory : audio_enc
register factory : video_dec
register factory : file_read_flow
register factory : file_write_flow
register factory : filter
register factory : link_flow
register factory : source_stream
register factory : muxer_flow
register factory : audio_dec
register factory : output_stream
register factory : move_detec
register factory : occlusion_detec
register factory : file_write_stream
register factory : file_read_stream
register factory : alsa_playback_stream
register factory : alsa_capture_stream
register factory : v4l2_capture_stream
register factory : v4l2_output_stream
register factory : drm_output_stream
rga_api version 1.3.0_[11] (RGA is compiling with meson base: $PRODUCT_BASE)
register factory : rkrga
register factory : through_guard
register factory : ANR
register factory : AEC
register factory : rockx_filter
register factory : nn_result_input
register factory : draw_filter
register factory : rknn
register factory : face_capture
register factory : rockface_detect
register factory : rockface_evaluate
register factory : rockface_bodydetect
register factory : rockface_recognize
#Display wxh: 720x1280
#Decode Mode: Hardware
#Loop Cnt: 0
##RKMEDIA Log level: 2
[RKMEDIA][SYS][Info]:text is all=2
[RKMEDIA][SYS][Info]:module is all, log_level is 2
[RKMEDIA][SYS][Info]:RK_MPI_VDEC_CreateChn: Enable VDEC[0] Start...
mpp[4049]: mpp_info: mpp version: unknown mpp version for missing VCS info
[RKMEDIA][VDEC][Info]:mpi control MPP_DEC_SET_PARSER_SPLIT_MODE ret = 0
mpp[4049]: mpp_rt: NOT found ion allocator
mpp[4049]: mpp_rt: found drm allocator
[RKMEDIA][VDEC][Info]:mpi set group limit = 32
[RKMEDIA][SYS][Info]:RK_MPI_VDEC_CreateChn: Enable VDEC[0] End!
Created new TCP socket 15 for connection
Connecting to 192.168.100.33, port 554 on socket 15...
...remote connection opened
Sending request: DESCRIBE rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream RTSP/1.0
CSeq: 2
User-Agent: ffrtspGet (LIVE555 Streaming Media v2017.10.28)
Accept: application/sdp


Received 184 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="IP Camera(G4247)", nonce="7ea37751064186a784d8a48c27f85e00", stale="FALSE"
Date:  Wed, Jun 05 2024 15:28:06 GMT


Resending...
Sending request: DESCRIBE rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream RTSP/1.0
CSeq: 3
Authorization: Digest username="admin", realm="IP Camera(G4247)", nonce="7ea37751064186a784d8a48c27f85e00", uri="rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream", response="093aad69165d144eb3713cda919a9211"
User-Agent: ffrtspGet (LIVE555 Streaming Media v2017.10.28)
Accept: application/sdp


Received 809 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/
Content-Length: 650

v=0
o=- 1717601286533122 1717601286533122 IN IP4 192.168.100.33
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=x-dimensions:1920,1080
a=control:rtsp://admin:abcd1234@192.168.10 ... av_stream/trackID=1
a=rtpmap:96 H265/90000
a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB7vAk=; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB7oAPAgBDljb7ky/NwEBAQCA==; sprop-pps=RAHA8rA7JA==
a=Media_header:MEDIAINFO=494D4B48010300000400050000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0

[URL:"rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/"]: Got a SDP description:
v=0
o=- 1717601286533122 1717601286533122 IN IP4 192.168.100.33
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=x-dimensions:1920,1080
a=control:rtsp://admin:abcd1234@192.168.10 ... av_stream/trackID=1
a=rtpmap:96 H265/90000
a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB7vAk=; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB7oAPAgBDljb7ky/NwEBAQCA==; sprop-pps=RAHA8rA7JA==
a=Media_header:MEDIAINFO=494D4B48010300000400050000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0

[URL:"rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/"]: Initiated the "video/H265" subsession (client ports 40356-40357)
Sending request: SETUP rtsp://admin:abcd1234@192.168.10 ... av_stream/trackID=1 RTSP/1.0
CSeq: 4
Authorization: Digest username="admin", realm="IP Camera(G4247)", nonce="7ea37751064186a784d8a48c27f85e00", uri="rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/", response="4296b3374657021c09e9aef0676e7c9f"
User-Agent: ffrtspGet (LIVE555 Streaming Media v2017.10.28)
Transport: RTP/AVP;unicast;client_port=40356-40357


Received 204 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Session:        571298944;timeout=60
Transport: RTP/AVP;unicast;client_port=40356-40357;server_port=8270-8271;ssrc=673e02be;mode="play"
Date:  Wed, Jun 05 2024 15:28:06 GMT


[URL:"rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/"]: Set up the "video/H265" subsession (client ports 40356-40357)
[URL:"rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/"]: Created a data sink for the "video/H265" subsession
Sending request: PLAY rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/ RTSP/1.0
CSeq: 5
Authorization: Digest username="admin", realm="IP Camera(G4247)", nonce="7ea37751064186a784d8a48c27f85e00", uri="rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/", response="3b9bb39a4f782e3c9dbabd1c067473bb"
User-Agent: ffrtspGet (LIVE555 Streaming Media v2017.10.28)
Session: 571298944
Range: npt=0.000-


Received 210 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 5
Session:        571298944
RTP-Info: url=rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/trackID=1;seq=17347;rtptime=3617570420
Date:  Wed, Jun 05 2024 15:28:06 GMT


[URL:"rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/av_stream/"]: Started playing session...


后来通过写文件(test_rtsp),记录获取的流信息,记录的文件大小为27字节。

请问如何解决?(另外,有没有可能开放ffrtsp的源码?)

test_rtsp.zip

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

回复

使用道具 举报

59

积分

0

威望

0

贡献

技术小白

积分
59
发表于 2024-6-6 10:39:19        只看该作者  沙发
以ffrtsp_demo_test为例,在FFRTSP_Send增加了打印代码后,实际是有数据发出的,并且通过save_file保存的文件也是可以播放的,但是在推流时,使用VLC无法拉取到流。
回复

使用道具 举报

59

积分

0

威望

0

贡献

技术小白

积分
59
发表于 2024-6-12 14:38:36        只看该作者  板凳
问题已解决,分析码流后发现输入的是H265,改成264即可
回复

使用道具 举报

28

积分

0

威望

0

贡献

技术小白

积分
28
发表于 2024-7-17 22:03:57        只看该作者  地板
你好,和你的问题一样,FFRTSP_Send 里打印,没问题,存下来的文件,改成test_rtsp_0.h264后,在VLC也能播放,你说的H265改成H264是怎么改,我改成这样,依旧无法推流
  1. static void *rtsppushbuff(void *data) {
  2.     printf("rtsp push buff \n");
  3.     // ffrtsph264Push((struct RTSP_PUSH_INFO *)data); //h265 需要用 ffrtsph265Push
  4.     ffrtsph265Push((struct RTSP_PUSH_INFO *)data);
  5. }
复制代码
回复

使用道具 举报

59

积分

0

威望

0

贡献

技术小白

积分
59
发表于 2024-7-18 09:31:04        只看该作者  5#
eejacky 发表于 2024-7-17 22:03
你好,和你的问题一样,FFRTSP_Send 里打印,没问题,存下来的文件,改成test_rtsp_0.h264后,在VLC也能播 ...

实际上是demo里有坑,系统代码里video_type的枚举与cfg配置文件里的枚举已经不匹配所致。系统代码里H264的枚举为5,H265才是6,而demo中配置文件告诉你H264的枚举是6,所以你配6的时候,实际推出来的是H265,自然无法播放。
解决方法就是video_type配成5
回复

使用道具 举报

28

积分

0

威望

0

贡献

技术小白

积分
28
发表于 2024-7-18 10:02:29        只看该作者  6#
chaney 发表于 2024-7-18 09:31
实际上是demo里有坑,系统代码里video_type的枚举与cfg配置文件里的枚举已经不匹配所致。系统代码里H264 ...

我是用的 demo 是ffrtsp_demo_test,并没有对于的cfg文件,我现在改成这样依旧无法推流
  1. static void *rtsppushbuff(void *data) {
  2.    
  3.     // ffrtsph264Push((struct RTSP_PUSH_INFO *)data); //h265 需要用 ffrtsph265Push

  4.     switch (((struct RTSP_PUSH_INFO *)data)->type)
  5.     {
  6.         case RK_CODEC_TYPE_H264:
  7.             ((struct RTSP_PUSH_INFO *)data)->type = RTSP_CODEC_H264;
  8.             break;
  9.         case RK_CODEC_TYPE_H265:
  10.             ((struct RTSP_PUSH_INFO *)data)->type = RTSP_CODEC_H265;
  11.             break;
  12.         default:
  13.             printf("error: video codec not support.\n");
  14.             break;
  15.     }
  16.     ffrtspPush((struct RTSP_PUSH_INFO *)data);
  17.     printf("rtsp push buff \n");
  18. }
复制代码
回复

使用道具 举报

59

积分

0

威望

0

贡献

技术小白

积分
59
发表于 2024-7-18 10:11:24        只看该作者  7#
eejacky 发表于 2024-7-18 10:02
我是用的 demo 是ffrtsp_demo_test,并没有对于的cfg文件,我现在改成这样依旧无法推流

我直接用的ffrtsph264Push,可以推。
你可以打印一下((struct RTSP_PUSH_INFO *)data)->type的值,看看与下面的两个枚举是否匹配
回复

使用道具 举报

28

积分

0

威望

0

贡献

技术小白

积分
28
发表于 2024-7-18 13:06:42        只看该作者  8#
呃呃,打印出来是0,对应看是MP3
  1. typedef enum rk_CODEC_TYPE_E {
  2.   RK_CODEC_TYPE_NONE = -1,
  3.   // Audio
  4.   RK_CODEC_TYPE_MP3,
  5.   RK_CODEC_TYPE_MP2,
  6.   RK_CODEC_TYPE_G711A,
  7.   RK_CODEC_TYPE_G711U,
  8.   RK_CODEC_TYPE_G726,
  9.   // Video
  10.   RK_CODEC_TYPE_H264,
  11.   RK_CODEC_TYPE_H265,
  12.   RK_CODEC_TYPE_JPEG,
  13.   RK_CODEC_TYPE_MJPEG,
  14.   RK_CODEC_TYPE_NB
  15. } CODEC_TYPE_E;
复制代码



  1. static void *rtsppushbuff(void *data)
  2. {
  3.     printf("aaaaa =====  %d \n", ((struct RTSP_PUSH_INFO *)data)->type);
  4.     printf("RK_CODEC_TYPE_H264 == %d \n", RK_CODEC_TYPE_H264);
  5.     printf("RK_CODEC_TYPE_H265 == %d \n", RK_CODEC_TYPE_H265);
  6.     ffrtsph264Push((struct RTSP_PUSH_INFO *)data); // h265 需要用 ffrtsph265Push
  7.     printf("rtsp push buff \n");
  8. }
  9. <div>
  10. </div><div>aaaaa =====  0
  11. RK_CODEC_TYPE_H264 == 5
  12. RK_CODEC_TYPE_H265 == 6</div>
复制代码


回复

使用道具 举报

59

积分

0

威望

0

贡献

技术小白

积分
59
发表于 2024-7-24 14:39:56        只看该作者  9#
eejacky 发表于 2024-7-18 13:06
呃呃,打印出来是0,对应看是MP3

所以啊,肯定拉不到流
回复

使用道具 举报

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

本版积分规则

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