Giter Site home page Giter Site logo

myrtspclient's Introduction

myRtspClient

This package contains a RTSP Client libraries which is based on JRTPLIB. Under the license of Apache License V2.0.

Linux/Unix installation

Now, myRtspClient installation is not supported. You can only compile the library ./myRtspClient/libmyRtspClient.a. And the headers is in ./myRtspClient/include.

Compiling based on different os-platform, you NEED to configure the config. file. For example: Compiling based on x86, which configure use file 'config.linux':

$ ./genMakefiles linux

$ make

(Configure your cross compile tool in 'config.armlinux' first) Compiling based on armlinux, which configure use file 'config.armlinux':

$ ./genMakefiles armlinux

$ make

Features

Video Codec Supported:

H264
H265

Audio Codec Supported:

MPA
g711(mu-law)

Cast Method Supported: Unicast

Info

Ansersion [email protected]

中文教程 http://www.cnblogs.com/ansersion/p/6959690.html

myrtspclient's People

Contributors

ansersion avatar lattice0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

myrtspclient's Issues

make this repo more searchable

I almost didn't find it. It's the best RTSP c++ library I could find, would be good for it to be more tagged so more people can find it and contribute to. I'll test with some cameras and contribute if I find any problems.

Authentication does not work

I am testing this against my Reolink C1-Pro, with username "admin" and password "password". I can get the low bitrate video stream by running:

./openRTSP -4 -I 192.168.1.240 -u admin password rtsp://192.168.1.5:554/h264Preview_01_sub > video.mp4

I can also get the full quality stream by swapping sub for main.

I have now tried using myRtspClient, and setting the same username and password in the code, but I am unable to start the streaming:

# ./complete_example rtsp://192.168.1.5:554/h264Preview_01_sub
Start play rtsp://192.168.1.5:554/h264Preview_01_sub
Then put video data into test_packet_recv.h264
RTSP/1.0 200 OK
CSeq: 1
Date: Mon, May 21 2018 21:05:28 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER


Select Timeout
CheckAuth: error
DoDESCRIBE error
# 

Searching trough the code, I cannot see the username and password being used much. It seems to me that it is not being used at all really, as the MakeMd5DigestResp calls are all missing the username and password. Is this supposed to be working?

Best regards

decode problem

I use bosch camera, and use your code from http://www.cnblogs.com/ansersion/p/5208845.html
我使用bosch的摄像头本来想用这个代码先解码 再编码为mjpeg,后面发现图片出来只有一半,然后我就用你代码SDL2显示了一下解码的图像,结果图像只有一半,请问这是怎么回事呢

http_tunnel port

I wonder difference bewteen RtspOverHttpDataPort and RtspPort . In http_tunnl_simple.cpp,I use SetHttpTunnelPort(8000) and SetPort(554),and then I find that client can't get option response.

No RTP data

你好,我使用master分支的代码,
1.在docker ubuntu16.04中执行以下命令

./recv_video_and_audio_example  rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov/
控制台打印如下:
Start play rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov/
Then put video data into test_video_recv.h264; And put audio data into test_audio_recv.mp3
MediaInfoCheck: 6781888
MyRTP_SetUp TCP: 0
Setup Session audio: MyRtsp: Success
MyRTP_SetUp TCP: 0
Setup Session video: MyRtsp: Success
PLAY Session audio: MyRtsp: Success
PLAY Session video: MyRtsp: Success
recv video data 1: 33 bytes
No RTP data
No RTP data
No RTP data
No RTP data
No RTP data
No RTP data

2.分析
通过wireshark / tcpdump 等抓包,发现rtsp交互流程到Play之后,但是使用VLC可以播放rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov/,通过对比之后,发现rtsp交互流程正确,但是服务器没有向客户端发送rtp数据包,所以 udpsession中的OnNewSource方法没有被触发。请问能帮我测下上边的rtsp地址吗?或者给我一些建议

3. 提一个bug
我发现libjrtp的依赖库jthread没有被正确的连接,编译完之后,libjrtp 生成的rtpconfig.h中,没有#define RTP_SUPPORT_THREAD

#define RTP_SUPPORT_IPV4MULTICAST

**// No support for JThread was enabled**

#define RTP_SUPPORT_SDESPRIV

#define RTP_SUPPORT_PROBATION

pause

why play after pause, rtp can't find "$" or "R"? I find error is happened in myTCPTransmitter.cpp ,74 line ( if(m_httpTunnelHeaderBuffer[0] != '$' && m_httpTunnelHeaderBuffer[0] != 'R'))

DESTROIED_CLBK

I want to know what the function of DESTROIED_CLBK should to do.What is the difference between it and the function of DoTEARDOWN? And how should I write the DESTROIED_CLBK?

Compiling for armlinux

ld: myRtpUdpSession.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZTVN7jrtplib14RTPIPv4AddressE' which may bind externally can not be used when making a shared object; recompile with -fPIC

ld error.

how to avoid program exiting

When the rtsp server is restarted and disconnected, the socket is interrupted. The following prompt appears. When I try to reconnect in the program, the program exits.
How can I solve the problem and avoid the program exiting, but I can reconnect to the rtsp server.

Adding destination
Deleting destination
No RTP data
: Error sending over socket 25, removing destination
No RTP data
No RTP data
No RTP data
No RTP data
No RTP data

High load

I have been testing different rtsp clients. OpenRTSP obviously being one. Most of the ones I have tested do leave a lot to be desired, but this library is ticking a lot of boxes for me, as I need to run it on an embedded system.

As such, i have been doing some tests, and I am somewhat surprised by the result. It seems that this library is using more resources than OpenRTSP. I was expecting the opposite to be honest. In the default setup, openRTSP uses approx 0.1s user, 0.3s system on my laptop for 30s recording, while this library uses 0.3s user and 0.3s system. System seems to be a fraction lower with this library, but user time is certainly higher. By increasing the USLEEP_UNIT I can get it down to < 0.2s, but that comes with it's own set of issues too, see below.

I am also seeing some video corruption from my Reolink C1-pro camera, the lower part of the frame seems to break up. That situation seems to improve if I reduce USLEEP_UNIT and increase the buffer size, but my laptop should have more than enough umph to handle this. I have yet to figure out why. I get these errors:

[h264 @ 0x7f4a28004e80] corrupted macroblock 38 42 (total_coeff=-1) 
[h264 @ 0x7f4a28004e80] error while decoding MB 38 42
[h264 @ 0x7f4a28004e80] concealing 251 DC, 251 AC, 251 MV errors in I frame
[h264 @ 0x7f4a28004e80] out of range intra chroma pred mode f=0/0   
[h264 @ 0x7f4a28004e80] error while decoding MB 14 28
[h264 @ 0x7f4a28004e80] concealing 1395 DC, 1395 AC, 1395 MV errors in I frame
[h264 @ 0x7f4a28004e80] corrupted macroblock 23 41 (total_coeff=-1) 
[h264 @ 0x7f4a28004e80] error while decoding MB 23 41
[h264 @ 0x7f4a28004e80] concealing 346 DC, 346 AC, 346 MV errors in I frame
Invalid UE golomb code=   0 aq=    0KB vq=   33KB sq=    0B f=0/0   
[h264 @ 0x7f4a28004e80] cbp too large (3199971767) at 51 43
[h264 @ 0x7f4a28004e80] error while decoding MB 51 43
[h264 @ 0x7f4a28004e80] concealing 158 DC, 158 AC, 158 MV errors in P frame
[h264 @ 0x7f4a28069100] corrupted macroblock 26 36 (total_coeff=-1) 
[h264 @ 0x7f4a28069100] error while decoding MB 26 36
[h264 @ 0x7f4a28069100] concealing 743 DC, 743 AC, 743 MV errors in I frame
[h264 @ 0x7f4a28004e80] Invalid level prefix 48KB sq=    0B f=0/0   
[h264 @ 0x7f4a28004e80] error while decoding MB 0 25
[h264 @ 0x7f4a28004e80] concealing 1649 DC, 1649 AC, 1649 MV errors in I frame
[h264 @ 0x7f4a28043120] Invalid level prefix 34KB sq=    0B f=0/0   
[h264 @ 0x7f4a28043120] error while decoding MB 12 39
[h264 @ 0x7f4a28043120] concealing 517 DC, 517 AC, 517 MV errors in P frame

So I am wondering what I am doing wrong here. I am sure that this library can work, but I am unable to do so it seems. I would be willing to help out with this and to get it working, but I don't know where to start really.

No RTP data

I'm trying to save a video from my vstarcam camera and I'm gettind this "no such media session" error. Could it be a bug in the camera's RTSP server?

 ./common_example rtsp://admin:[email protected]:10554/tcp/av0_0
Start play rtsp://admin:[email protected]:10554/tcp/av0_0
Then put video data into test_packet_recv.h264
connect error: Network is unreachable
connect error: Network is unreachable
connect error: Network is unreachable
/av0_0/av0_0start PLAY
SDP: 
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
...
GetMediaData: No such media session
GetMediaData: No such media session
start TEARDOWN
lz@vm:~/myRtspClient/example$ 

SDP_FMTP_H264_PATTERN enhancement request

Hi, I found an ip camera that doesn't verify the regex SDP_FMTP_H264_PATTERN in sdp_data.cpp

This (from a different camera) works:
"fmtp:96 packetization-mode=1;profile-level-id=64001E;sprop-parameter-sets=Z2QAHqwrUFAX/Kg=,aO48MA=="

But this from my new ip camera doesn't work:
"fmtp:96 profile-level-id=4D401E;packetization-mode=0;sprop-parameter-sets=Z01AHpWgKAv+WbAQ,aO48gA==;config=00000001674d401e95a0280bfe59b0100000000168ee3c800000000106f02c1645cdee00110667ebad2bed54aaa0524e66e229ca86a9f5b918bc766a6690a60bca273da4d6ffffffffff7380"

The issue is caused by 'profile-level-id' which is put before packetization-mode

So please replace the current regex:
fmtp:(.+) +packetization-mode=([0-2]);.*sprop-parameter-sets=([A-Za-z0-9+/=]+),([A-Za-z0-9+/=]+)
with the following:
fmtp:(.+).+packetization-mode=([0-2]);.*sprop-parameter-sets=([A-Za-z0-9+/=]+),([A-Za-z0-9+/=]+)
(I placed a dot before +packetization-mode)

thanks and regards
f

Compiling for iOS

I am trying to compile this on Mac for iOS arm64 device, but was not successful.

My config file is here:

IOS_VERSION = 13.1
DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
TOOL_PATH = $(DEVELOPER_PATH)/usr/bin
SDK_PATH = $(DEVELOPER_PATH)/SDKs
SDK = $(SDK_PATH)/iPhoneOS$(IOS_VERSION).sdk
COMPILE_OPTS = $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O2 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC -stdlib=libc++ -arch arm64 --sysroot=$(SDK) -v
C = c
C_COMPILER = /usr/bin/xcrun clang
C_FLAGS = $(COMPILE_OPTS)
CPP = cpp
CPLUSPLUS_COMPILER = /usr/bin/xcrun clang++
CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall
OBJ = o
LINK = /usr/bin/xcrun clang -o
LINK_OPTS = -v -L. -arch arm64 --sysroot=$(SDK) -L$(SDK)/usr/lib/system /usr/lib/libc++.dylib
CONSOLE_LINK_OPTS = $(LINK_OPTS)
LIBRARY_LINK = /usr/bin/xcrun libtool -static -o
LIBRARY_LINK_OPTS =
LIB_SUFFIX = a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =

I got error a missing vtable for jrtplib.

Do you know what to do for Cross Compiling for iOS arm64 on macOS?

please avoid unnecessary complications

Current build configuration file for linux suggests that the C++11 compiler is required in order to build:

config.linux: COMPILE_OPTS = $(INCLUDES) -I. -O2 -std=c++11 -fPIC

but, in reality, only one single line of code cannot be compiled by an older gcc v4.8 that we're only allowed to use in our research, and which doesn't understand C++11.

rtspClient.cpp:110 RtspClient::RtspClient(string uri): RtspClient()

The above is a minor problem which can be fixed in no time.

Author: if you do not mind, please remove the C++11 dialect requirement. Thanks.

Is there any plan to support the basic authentication? [feature request]

Current repository only supports the digest authentication, which is also more complicated and heavily used in the practical world. However, in some rare cases where IPCs would need the basic authentication, the library fails to pull the data out. Is there a plan to support this? Thanks.

Regex error: Invalid range end

I'm getting, on my Vstarcam cameras, the following error:

Regex Error: Invalid range end

I debugged and the content of int MyRegex::Regex(const char * str, const char * pattern, list<string> * groups, bool ignore_case)

is the following:

str:


RTSP/1.0 200 OK
Cseq: 4
Date: Sun, Jul 07 2019 20:41:37 GMT
Session: 8595286076118481578
Transport: RTP/AVP/TCP;unicast;interleaved=0-1

pattern:

Session: +([0-9a-zA-Z_\$-.\..\+]+)

No RTP data

我用的comm_example 在嵌入式板子上跑的 前面建立rtsp信息打印出来了,但是后面传数据就全部是No RTP data 会不会是我开发板的网络的问题? No RTP data 是udp 视频流获取不到吗

multiple streams within the same RTP session are handled incorrectly

The problem caused by the fact that all streams within the same session are assigned with the same "client_port=" port pair. This causes, for example, audio packets to be injected into a video stream ...

SETUP rtsp://10.10.9.105/axis-media/media.amp/stream=1 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=10330-10331
CSeq: 2

. . . .

SETUP rtsp://10.10.9.105/axis-media/media.amp/stream=0 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=10330-10331
CSeq: 3

./recv_video_and_audio_example rtsp://10.10.9.105/axis-media/media.amp
Start play rtsp://10.10.9.105/axis-media/media.amp
Then put video data into test_video_recv.h264; And put audio data into test_audio_recv.mp3
debug: mt=video,line=rtpmap:96 H264/90000
debug: mt=video,line=fmtp:96 packetization-mode=1;profile-level-id=4d0029;sprop-parameter-sets=Z00AKeKQCgC3YC3AQEBpB4kRUA==,aO48gA==
debug: mt=video,line=control:rtsp://10.10.9.105/axis-media/media.amp/stream=0
debug: mt=video,line=framerate:5.000000
debug: mt=video,line=transform:1.000000,0.000000,0.000000;0.000000,1.000000,0.000000;0.000000,0.000000,1.000000
debug: mt=audio,line=rtpmap:97 MPEG4-GENERIC/16000/1
debug: mt=audio,line=fmtp:97 streamtype=5;profile-level-id=2;mode=AAC-hbr;config=1408;sizelength=13;indexlength=3;indexdeltalength=3;bitrate=64000
debug: mt=audio,line=control:rtsp://10.10.9.105/axis-media/media.amp/stream=1
MediaInfoCheck: 0
Setup Session audio: MyRtsp: Success
MyRTP_SetUp TCP: 0
Setup Session video: MyRtsp: Success
PLAY Session audio: MyRtsp: Success
PLAY Session video: MyRtsp: Success
Adding destination 10.10.9.105:50002
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Adding destination 10.10.9.105:50000
recv video data 10: 58682 bytes
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
recv video data 13: 1616 bytes
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
recv video data 17: 1272 bytes
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error

CheckAuth: error

Hi there,

I am triying to connect a TP-Link C200 Camera.
Using OpenRTSP I can connect perfectly using ./openRTSP -t -4 -P 10 rtsp://888888:[email protected]:554/stream2
With myRtspClient I use ./complete_example rtsp://192.168.1.82:554/stream2, previously I am set username and password in complete_example.cpp.
the response is:

Start play rtsp://192.168.1.82:554/stream2
Then put video data into test_packet_recv.h264
RTSP/1.0 200 OK
CSeq: 1
Date: Thu, Jun 25 2020 09:35:01 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER


CheckAuth: error
DoDESCRIBE error

The error is in line 2000 of rtspClient.cpp:

	if(!IsResponse_200_OK()) {
		return CHECK_ERROR;
	}

If I change return CHECK_ERROR for return CHECK_OK
The new response is:

Start play rtsp://192.168.1.82:554/stream2
Then put video data into test_packet_recv.h264 HOLAAAA
RTSP/1.0 200 OK
CSeq: 1
Date: Thu, Jun 25 2020 09:12:23 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER


RTSP/1.0 401 Unauthorized
CSeq: 3
Date: Thu, Jun 25 2020 09:12:23 GMT
WWW-Authenticate: Digest realm="TP-LINK Streaming Media", nonce="75f8c61d0f9ebdadedb7bb501628d4e7"

DoDESCRIBE error

My RTSP knowledge is null.
Could you help me?

Thanks!

Switching video memory is increasing!

Our project needs to switch video streams. When doing stress tests, we find that memory is constantly increasing.The test code is as follows:

HI_VOID * play_rtsp(HI_VOID *pArgs)
{

RtspClient Client;
string RtspUri(pstVdecSend->cFileName);	
const size_t BufSize=pstVdecSend->s32MinBufSize;
HI_U8 *pbuf;
size_t size = 0;

pbuf=(HI_U8*)malloc(BufSize);
while(1)
{
	Client.SetURI(RtspUri);
	Client.DoDESCRIBE();
	Client.ParseSDP();
	Client.DoSETUP("video", true);
	Client.SetVideoByeFromServerClbk(ByeFromServerClbk);
	printf("start PLAY\n");
	//printf("SDP: %s\n", Client.GetSDP().c_str());
	Client.DoPLAY("video");
	
	
	printf("start TEARDOWN\n");
	Client.DoTEARDOWN();
	sleep(1);
}
free(pbuf);
return (HI_VOID *)HI_SUCCESS;

}

Unauthorized problem

I am now using Bosch IP camera, the rtsp is available with user and password. Also I read the issues here and modify two lines related to the password and user.

But I still get 400 error when running the example code when I use the correct user name and password.

Do I miss something?

rtsp 发现有丢包现象这个是啥原因呢 我用live555 客户端没有这个问题

已经按照前面的一个issue里修改了对应的buffer 大小和usleep的time

Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
recv video data 132: 5903 bytes
recv video data 133: 6257 bytes
recv video data 134: 5116 bytes
recv video data 135: 5617 bytes
recv video data 136: 5187 bytes
recv video data 137: 5189 bytes
Error(H264): Unknown NALU Type(PM=1,NT=0)
ParsePacket error
recv video data 139: 5185 bytes
recv video data 140: 5621 bytes
recv video data 141: 5143 bytes
recv video data 142: 5332 bytes
recv video data 143: 5701 bytes
recv video data 144: 5800 bytes
Error(H264): Unknown NALU Type(PM=1,NT=0)

There is a frame loss situation when using multiple channels

In the case of acquiring multiple video streams and one thread per path, there is a phenomenon of frame dropping. By capturing the packet, the machine has received the lost packet, but the program has not received it. Below is my code.
bool RtspClient::isPlay() { bool isplay=false; pthread_mutex_lock( &this->playMutex ); if(this->Del==0&&this->used==1) isplay=true; pthread_mutex_unlock( &this->playMutex ); return isplay; } uint32_t timesTamp=0; while( Client->isPlay()) { uint8_t* ret = Client->GetMediaData("video", buf, &size, bufSize,&timesTamp); }
I added the get rtp timestamp and found that there is a frame loss situation at 25fps. I use the way of RTSP over TCP to get data. I want to ask the function uint8_t * MyRTPTCPSession::GetMyRTPData(uint8_t * data_buf, size_t * size, unsigned long timeout_ms) whether it is multi-thread safe
image

No RTP data

你好!我在接收一个recv 55后,出现30个No RTP data,请问这是什么问题

When my rtsp server adds audio, the complete_example program error

When my rtsp server adds audio, the complete_example program error. VLC media player
connects to rtsp server, it can play video and audio normally

/mnt/myRtspClient/example # ./complete_example rtsp://192.168.1.21/live.sdp
Start play rtsp://192.168.1.21/live.sdp
Then put video data into test_packet_recv.h264
RTSP/1.0 200 OK
CSeq: 1
Date: Thu Jan 1 08:01:26 1970
Public: OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN
Server: rtsp_demo

[Client.GetResponse().c_str()]RTSP/1.0 200 OK
CSeq: 2
Date: Thu Jan 1 08:01:26 1970
Server: rtsp_demo
Content-Type: application/sdp
Content-Length: 416

v=0
o=- 0 0 IN IP4 0.0.0.0
s=rtsp_demo
t=0 0
a=control:rtsp://192.168.1.21/live.sdp
a=range:npt=0-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;sprop-parameter-sets=Z0IAKp2oHgCJ+WbgICAgQA==,aM48gA==
a=control:rtsp://192.168.1.21/live.sdp/track1
m=audio 0 RTP/AVP 97
c=IN IP4 0.0.0.0
a=rtpmap:97 PCMA/48000/1
a=control:rtsp://192.168.1.21/live.sdp/track2

debug: mt=video,line=rtpmap:96 H264/90000
debug: mt=video,line=fmtp:96 packetization-mode=1;sprop-parameter-sets=Z0IAKp2oHgCJ+WbgICAgQA==,aM48gA==
debug: mt=video,line=control:rtsp://192.168.1.21/live.sdp/track1
debug: mt=audio,line=rtpmap:97 PCMA/48000/1
debug: mt=audio,line=control:rtsp://192.168.1.21/live.sdp/track2
MyRTP_SetUp TCP: 0
Setup Session audio: MyRtsp: Success
MyRTP_SetUp TCP: 0
Setup Session video: MyRtsp: Success
RTSP/1.0 454 Session Not Found
CSeq: 4
Date: Thu Jan 1 08:01:26 1970
Server: rtsp_demo

DoSETUP error

WARNING: There are some RTSP packages unreceived when run inside docker

When I run the common example inside docker (which works outside it), I get this weird output:

root@3067b1df30ff:/home/orwell/myRtspClient/example# ./common_example rtsp://admin:[email protected]:10554/tcp/av0_0
Start play rtsp://admin:[email protected]:10554/tcp/av0_0
Then put video data into test_packet_recv.h264
MyRTP_SetUp TCP: 3
Adding destination
ERROR: Can't retrieve login name
start PLAY
SDP: v=0
o=VSTC 3758819840 3758819840 IN IP4 192.168.0.103
s=streamed by the VSTARCAM RTSP server
e=NONE
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 96
b=AS:1024
a=control:track0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d002a;sprop-parameter-sets=Z00AKp2oHgCJ+WbgICAoAAADAAgAAAMAfCA=,aO48gA==
m=audio 0 RTP/AVP 8	 
b=AS:64
a=control:track1
a=rtpmap:8 PCMA/8000/1


recv 38
ERROR: The RTP session was not created
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
WARNING: There are some RTSP packages unreceived
...

I've found the source of the string error. It happens when myRtpSession can't lock the mutex.

Do you have any reason why it has this problem inside docker?

GetMediaData: No such media session

When I connect to the rtsp server, the program keeps prompting "GetMediaData: No such media session", and the server prompts "client not support accept SDP." My rtsp server can run normally, and the VLC media player can receive the video. Excuse me, what is this question?

start PLAY
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
GetMediaData: No such media session
.....

connect error: Network is unreachable DoOPTIONS error

Thanks for sharing the code. I compiled both the library and the examples following the instructions. When using the complete_example to access my IPCamera, it outputs this info:

./complete_example rtsp://admin:[email protected]:554/video/0
Start play rtsp://admin:[email protected]:554/video/0
Then put video data into test_packet_recv.h264
connect error: Network is unreachable
DoOPTIONS error

I can use ffplay to play the rtsp link, but once in a while, it pops up warning message like:

Invalid UE golomb code= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
Last message repeated 1 times
Invalid UE golomb code=

And I tried the other examples. None of them works. Did I miss something here?

DoOPTIONS error for Android

I've been using this lib for months on linux but I get error in DoOptions on Android (arm 64 bits):

	if (!myRtspClient.IsResponse_200_OK())
	{
		LOG << "RTSP DoOPTIONS() not ok for " << this->uri;
		LOG << myRtspClient.GetSDP();
		return 2;
	}

This is the output:

V/SLOG    (16585): 23:29:40 22/10, info: RTSP DoOPTIONS() not ok for rtsp://admin:[email protected]:10554/tcp/av0_0
V/SLOG    (16585): 23:29:40 22/10, info: v=0
V/SLOG    (16585): o=VSTC 3780782848 3780782848 IN IP4 192.168.0.101
V/SLOG    (16585): s=streamed by the VSTARCAM RTSP server
V/SLOG    (16585): e=NONE
V/SLOG    (16585): c=IN IP4 0.0.0.0
V/SLOG    (16585): t=0 0
V/SLOG    (16585): m=video 0 RTP/AVP 96
V/SLOG    (16585): b=AS:1024
V/SLOG    (16585): a=control:track0
V/SLOG    (16585): a=rtpmap:96 H264/90000
V/SLOG    (16585): a=fmtp:96 packetization-mode=1;profile-level-id=4d002a;sprop-parameter-sets=Z00AKp2oHgCJ+WbgICAoAAADAAgAAAMAfCA=,aO48gA==
V/SLOG    (16585): m=audio 0 RTP/AVP 8	 
V/SLOG    (16585): b=AS:64
V/SLOG    (16585): a=control:track1
V/SLOG    (16585): a=rtpmap:8 PCMA/8000/1
V/SLOG    (16585): 
V/SLOG    (16585): 

Did you use this lib with android succefully? Do you have any idea on what's happening?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.