Firefly开源社区

标题: 运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流 [打印本页]

作者: chaney    时间: 2024-6-5 16:11
标题: 运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流
运行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的源码?)
tchip_askquestions

test_rtsp.zip

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


作者: chaney    时间: 2024-6-6 10:39
以ffrtsp_demo_test为例,在FFRTSP_Send增加了打印代码后,实际是有数据发出的,并且通过save_file保存的文件也是可以播放的,但是在推流时,使用VLC无法拉取到流。
作者: chaney    时间: 2024-6-12 14:38
问题已解决,分析码流后发现输入的是H265,改成264即可
作者: eejacky    时间: 2024-7-17 22:03
你好,和你的问题一样,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. }
复制代码

作者: chaney    时间: 2024-7-18 09:31
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
作者: eejacky    时间: 2024-7-18 10:02
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. }
复制代码

作者: chaney    时间: 2024-7-18 10:11
eejacky 发表于 2024-7-18 10:02
我是用的 demo 是ffrtsp_demo_test,并没有对于的cfg文件,我现在改成这样依旧无法推流

我直接用的ffrtsph264Push,可以推。
你可以打印一下((struct RTSP_PUSH_INFO *)data)->type的值,看看与下面的两个枚举是否匹配
作者: eejacky    时间: 2024-7-18 13:06
呃呃,打印出来是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>
复制代码



作者: chaney    时间: 2024-7-24 14:39
eejacky 发表于 2024-7-18 13:06
呃呃,打印出来是0,对应看是MP3

所以啊,肯定拉不到流




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1