Receive rtsp stream using gstreamer - c++

I want to receive rtsp stream using gstreamer I knw rtspsrc can be used for this purpose but the problem is that it only receives it as a client but in my case i have a ffmpeg application which streams the video as a client and waits for a server to connect with it before streaming. So i want gstreamer to act as server and receive the stream from ffmpeg

I haven't used it myself, but I believe there is a separate package for RTSP server functionality. In Debian based systems it should be under something like:
libgstrtspserver-0.10-0

Related

Query Gstreamer rtsp methods, like PLAY, DESCRIBE etc

I can't figure out how to call rtsp methods with headers, for understanding:
I have an rtsp player on qt, I want to add the rtsp playback speed functionality, many vendors do this by sending a PLAY request with a Speed header,
but I don't understand how I can send this request from gstreamer.
You set playback rate for the pipeline via a GstSegemnt. E.g. when issueing a seek command. See https://gstreamer.freedesktop.org/documentation/gstreamer/gstsegment.html#GstSegment.
rtspsrc should then take care of sending the required header info to the RTSP server when initiating the session.

GStreamer: Intercept End of Stream Event and restart

I'm implementing an RTSP server which reads a video H264 file stream and makes it available under RTSP protocol.
The idea is this:
The server creates a pipeline using video1.mp4 as videosrc and then, when video ends and the EOS event is generated, it has to switch filesrc to video2.mp4 and restart streaming automatically. When video2.mp4 ends it switches back to video1.mp4 again. The client is supposed to never stop receiving a video stream in this way.
Is it possible to obtain a server behavior like this?
Cheers

RTSP Streaming Server C++

I would like to write a RTSP streaming server using C++. Multiple clients will be connected to this server for receiving the streamed data.
What I understand is that I need to do socket programming in C++ for client server architecture.
I know FFMPEG has command line support for streaming audio/video. But my requirement is writing a client server socket model in C++.
I had a look at https://www.medialan.de/usecase0001.html
I am also looking at this. https://www.youtube.com/watch?v=MEMzo59CPr8
but I am not sure if this will help me.
For streaming the audio/video data, Do i need to use FFMEPG APIs. If yes, which libraries of FFMPEG i need to use?.
I think I will use gstreamer RTSP server.
Gstreamer is easy to use.
I tried sample example and I was able to stream a video over RTSP.
No, you don’t need ffmpeg to write an RTSP server.

Send Gstreamer RTP packets using SIP

I have an RTP audio stream provided by gstreamer and I want to send them using a SIP communication. Does anybody know how can I do it? Do I need a SIP proxy like OpenSIPS?

live555 problem while streaming over the internet

I've compiled with VS the live555 source code, and it works just fine if I try to stream locally a file
e.g.
Command Line:
live555.exe myfile.mp3
VLC Connection String
rtsp://169.254.1.231:8554/myfile.mp3
but if I try to stream it over the internet, VLC communicates with live555, but live555 won't send data to him
Command Line
live555.exe myfile.mp3
VLC Connection String
rtsp://80.223.43.123:8554/myfile.mp3
I've already forwarded the 8554 port (both tcp/udp) and tried to disable my firewall but this doesn't solve.
How is that?
To troubleshoot:
Are you streaming RTP over RTSP: have you checked the "Use RTP over RTSP (TCP)" option in VLC? You can check this in VLC under the preferences: input/codecs->Demuxers->RTP/RTSP. You can try to see if this solves the problem in which case it could be that UDP is blocked.
You speak of forwarding. Do you mean port forwarding from one machine to the RTSP server? if so-> if you are not doing RTP over RTSP, then you would also need to forward the ports for the media which is not the same as the RTSP port (554 or 8554). These ports are exchanged during the RTSP SETUP. If you do RTP over RTSP the media is interleaved over 554 or 8554 and you don't have to worry about this.
Also, another good debugging tool is the live555 openRTSP application. You can run it from the command line and specify "-t" for RTP over RTSP, which is basically what the VLC option does. You can specify "-T" for HTTP tunneling, etc and it allows you to write captured media packets to file, etc.