运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流
运行rkmedia_rtspget_***的一系列示例, 在FFRKMedia_Vdec_Send回调中无法获取流,程序会卡在Started playing session...完整的日志如下:
# ./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_ (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
:text is all=2
:module is all, log_level is 2
:RK_MPI_VDEC_CreateChn: Enable VDEC Start...
mpp: mpp_info: mpp version: unknown mpp version for missing VCS info
:mpi control MPP_DEC_SET_PARSER_SPLIT_MODE ret = 0
mpp: mpp_rt: NOT found ion allocator
mpp: mpp_rt: found drm allocator
:mpi set group limit = 32
:RK_MPI_VDEC_CreateChn: Enable VDEC 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.100.33:554/h264/1/main/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
: 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.100.33:554/h264/1/main/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
: Initiated the "video/H265" subsession (client ports 40356-40357)
Sending request: SETUP rtsp://admin:abcd1234@192.168.100.33:554/h264/1/main/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
: Set up the "video/H265" subsession (client ports 40356-40357)
: 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
: Started playing session...
后来通过写文件(test_rtsp),记录获取的流信息,记录的文件大小为27字节。
请问如何解决?(另外,有没有可能开放ffrtsp的源码?)
以ffrtsp_demo_test为例,在FFRTSP_Send增加了打印代码后,实际是有数据发出的,并且通过save_file保存的文件也是可以播放的,但是在推流时,使用VLC无法拉取到流。 问题已解决,分析码流后发现输入的是H265,改成264即可 你好,和你的问题一样,FFRTSP_Send 里打印,没问题,存下来的文件,改成test_rtsp_0.h264后,在VLC也能播放,你说的H265改成H264是怎么改,我改成这样,依旧无法推流
static void *rtsppushbuff(void *data) {
printf("rtsp push buff \n");
// ffrtsph264Push((struct RTSP_PUSH_INFO *)data); //h265 需要用 ffrtsph265Push
ffrtsph265Push((struct RTSP_PUSH_INFO *)data);
} 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 chaney 发表于 2024-7-18 09:31
实际上是demo里有坑,系统代码里video_type的枚举与cfg配置文件里的枚举已经不匹配所致。系统代码里H264 ...
我是用的 demo 是ffrtsp_demo_test,并没有对于的cfg文件,我现在改成这样依旧无法推流
static void *rtsppushbuff(void *data) {
// ffrtsph264Push((struct RTSP_PUSH_INFO *)data); //h265 需要用 ffrtsph265Push
switch (((struct RTSP_PUSH_INFO *)data)->type)
{
case RK_CODEC_TYPE_H264:
((struct RTSP_PUSH_INFO *)data)->type = RTSP_CODEC_H264;
break;
case RK_CODEC_TYPE_H265:
((struct RTSP_PUSH_INFO *)data)->type = RTSP_CODEC_H265;
break;
default:
printf("error: video codec not support.\n");
break;
}
ffrtspPush((struct RTSP_PUSH_INFO *)data);
printf("rtsp push buff \n");
} eejacky 发表于 2024-7-18 10:02
我是用的 demo 是ffrtsp_demo_test,并没有对于的cfg文件,我现在改成这样依旧无法推流
我直接用的ffrtsph264Push,可以推。
你可以打印一下((struct RTSP_PUSH_INFO *)data)->type的值,看看与下面的两个枚举是否匹配 呃呃,打印出来是0,对应看是MP3
typedef enum rk_CODEC_TYPE_E {
RK_CODEC_TYPE_NONE = -1,
// Audio
RK_CODEC_TYPE_MP3,
RK_CODEC_TYPE_MP2,
RK_CODEC_TYPE_G711A,
RK_CODEC_TYPE_G711U,
RK_CODEC_TYPE_G726,
// Video
RK_CODEC_TYPE_H264,
RK_CODEC_TYPE_H265,
RK_CODEC_TYPE_JPEG,
RK_CODEC_TYPE_MJPEG,
RK_CODEC_TYPE_NB
} CODEC_TYPE_E;
static void *rtsppushbuff(void *data)
{
printf("aaaaa =====%d \n", ((struct RTSP_PUSH_INFO *)data)->type);
printf("RK_CODEC_TYPE_H264 == %d \n", RK_CODEC_TYPE_H264);
printf("RK_CODEC_TYPE_H265 == %d \n", RK_CODEC_TYPE_H265);
ffrtsph264Push((struct RTSP_PUSH_INFO *)data); // h265 需要用 ffrtsph265Push
printf("rtsp push buff \n");
}
<div>
</div><div>aaaaa =====0
RK_CODEC_TYPE_H264 == 5
RK_CODEC_TYPE_H265 == 6</div>
eejacky 发表于 2024-7-18 13:06
呃呃,打印出来是0,对应看是MP3
所以啊,肯定拉不到流
页:
[1]