bad request in response to RTSP client SETUP request - rtsp

I'm imlempenting a RTSP client over TCP to communicate with the live555MediaServer .
The problem is that the server replies with "bad request 400" to my SETUP request
Could any one help me please ?
this is my setup request
"SETUP rtsp://192.168.121.133:8554/test.mpg RTSP/1.0\r\nCSeq: 3\r\nTransport: RTP/AVP;unicast;client_port=9000-9001\r\n\r\n";

There are a couple of issues with your command:
Take a look at the URL your are using in SETUP command, it should be the same (for each media stream, audio and video) you received as a reply to your DESCRIBE command.
You are actually setting up RTP over UDP, not TCP. RTP/AVP defaults to UDP (RFC2326, 12.39). TCP SETUP command should look something like: "SETUP ... RTSP/1.0\r\n\CSeq:...\r\nTransport: RTP/AVP/TCP;interleaved=0-1\r\n\r\n". Command details are described in RFC2326, 12.39

Related

How can i send multiple camera to one server

How can i send all webcams to collect from one server.
For example:
there is pc_1, pc2, ..., pc_n they are sending camera view to some ubuntu server where i can connect with
ssh name#ip_adress
and all pc have a windows on them
i looked Sending live video frame over network in python opencv this but this worked only on localhost
and secondly i looked this Forward RTSP stream to remote socket (RTSP Proxy?) but couldnt figure out how to do it on my situation
Each IPC is a RTSP server, it allows you to pull/play RTSP stream from it:
IPC ---RTSP--> Client(Player/FFmpeg/OBS/VLC etc.)
And because it's a internal IPC and its IP is intranet, so the client should in the same intranet, that's why it works only on localhost like.
Rather than pulling from the internet client which does not work, you could forward the stream to internet server, just like this:
IPC ---RTSP--> Client --RTMP--> Internet Server(SRS/Nginx etc.)
For example, use FFmpeg as a Client to do this, please replace the xxx by your internet server:
ffmpeg -i "rtsp://user:password#ip" -c:v libx264 -f flv rtmp://xxx/live/stream
Note: You could fastly deploy a internet server by srs-droplet-template in 3 minutes, without any cli or knowledge about media server.
Then you could play the stream by any client and any protocol, like PC/H5 by HTTP-FLV/HLS/WebRTC, mobile iOS/Android by HTTP-FLV/HLS, please read this post

Spring Integration TCP - I have requirement to use Spring for Non-Spring TCP Server

Spring-Integration , TCP Serve will push Packet to my Application and once packet received will send Ack to server. At last send final response once after processing done. I have to keep connection open until packet processed. I am new
Please help.
Sounds like you need to use a TcpInboundGateway with the TcpNetClientConnectionFactory: https://docs.spring.io/spring-integration/docs/5.0.7.RELEASE/reference/html/ip.html#tcp-connection-factories

What will happen if I don't response RTSP GET_PARAMETER command?

I'm developing a RTSP Server and UDP works fine, but there's 1 issue when it's goes to TCP which is the VLC only can view streaming about 30 minutes, from the packet I see that I didn't response the RTSP GET_PARAMETER command, is this command matters and what will happen is I don't response this command?
According to the specification, GET_PARAMETER is optional for servers and clients to implement.

Session start request using UDP sockets

I have been using UDP sockets to send and receive voice through RTP packetization. It is pretty straightforward. I just send my mic voice signals ( that are encoded ) over IP using User Datagram socket , and on the other end i receive the UDP-RTP packets and decode them to be able to play them on my speakers.
I have been searching on internet for a while to find a way to start up a session using UDP sockets. What i want to to is to a Handshake-like process between two ends of my conversation and after the requests were acknowledged the media layer ( which i described in first paragraph ) would fire and start sending voice.
I have not been able to find any tutorials on session request using UDP sockets but i suppose it shouldnt be impossible.( one user sends a request to build a session and if the other user confirms media layer starts)
Has anyone done something like this before? any info is welcome.
Firstly, UDP is a connectionless, unreliable protocol, you won't find anything like handshaking for negotiating connection i.e no session management. But, to transport RTP packets it's not a good idea to use tcp, it lacks realtime feature, so you have to stick with UDP. Now, to overcome the signaling problem you can use protocols like. SIP. It's standard signaling protocol used in VOIP. SIP initiates a connection before sending RTP packets. To properly use SIP and RTP you might have to take help of another protocol called SDP, which tells which port to use for transmitting RTP and other various info. You can get more info about these techniques here. Hope this will helps!

Non-blocking service to receive messages on port via UDP

I want to build a service on my Linux VPS which listens to a certain UDP port and does something with the (text)message which is captured. This processing consists of appending the message to a locally stored txt-file and send it as http, with a post variable to another server.
I've looked into Nginx but as far is can see this server can only be bound to receive http packets. Although it is asynchronous.
What is the best way to achieve this listening-service on linux? And which has the capabilities to do the above mentioned processing?
Is for instance node.js a possibilty? It looks great
For simplicity, you can use xinetd, and for the app you can use any scripting language, which will read the packet from the stdin and save it to the file.

Resources