Tal Darom
Tal Darom

Reputation: 1409

streaming video into a gstreamer rtsp server

I am trying to build an rtsp video server based on gstreamer. In my case I need the client to connect to the server and start streaming video to the server.

I have read some tutorials on this subject especially this one: http://www.ip-sense.com/linuxsense/how-to-develop-a-rtsp-server-in-linux-using-gstreamer/

In this tutorial the video is streamed from the server to the client and I need to change that so the video will be streamed from the client to the server.

EDIT: In the demo this pipeline is launched:

gst_rtsp_media_factory_set_launch (factory, "( "
          "videotestsrc ! video/x-raw-yuv,width=320,height=240,framerate=10/1 ! "
          "x264enc ! queue ! rtph264pay name=pay0 pt=96 ! audiotestsrc ! audio/x-raw-int,rate=8000 ! alawenc ! rtppcmapay name=pay1 pt=97 "")");

The pipeline starts with video and audio test sources and encodes them into payload 0 and 1. I need to do the opposite - take the rtsp payload and decode it.

Upvotes: 3

Views: 16299

Answers (3)

umläute
umläute

Reputation: 31374

for decoding RTSP-streams received by the client from the server, use the rtspsrc

gst-launch rtspsrc location=${LOCATION} \
           ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! xvimagesink

but your question seems to be targetted at pushing a payload to a server, rather than pulling it from the server (at least it was before you edited it...now it is a bit unclear to me).

the gstrtspserver framework seems to be targetted at the common usecase for RTSP: clients pulling data from a server. if you want to revert that, your best start is probably to hack the gstrtspserver library into a gstrtsppushclient framework (simply exchanging the connection logic should do the trick). you will also have to re-implement the receiving (server) side.

but then it's not really RTSP any more (in the sense, that you won't find any other applications out there, that can deal with yours).

you should probably rethink your architecture. a good start to read is probably RFC2326

Upvotes: 2

Mustafa
Mustafa

Reputation: 124

Although this question was asked long ago but I am going to answer for someone else who might be looking for it. To achieve this using GStreamer.

  1. Gstreamer now has a RTSP media server Here
  2. Gstreamer also has a GstRtspClientSink element which allows you to send a stream to compatible RTSP media server. A basic command line example is "gst-launch-1.0 videotestsrc ! queue ! x264enc ! rtspclientsink location=rtsp://127.0.0.1:8554/test" assuming the media server is running on localhost, port 8554 and expecting a publish point "test"
  3. An example of GStreamer RTSP server based application that accepts stream from client is available Here

Upvotes: 5

Wes Miller
Wes Miller

Reputation: 2241

If all you really want is a "server" that receives streamed input from a "client" just reverse the roles of the server and client applications. Write a client that is always there You may need to have some sort of restart loop so that if the end of the incoming stream ends you pipe, you just restart it. Additionally, your client would need to do whatever it is you want done with the data; store it, show it, rebroadcast it(???).

Now the client (used to be the server) code can be modified to send the data to the server (used to be the client) and then, say, terminate or wait for another stream to transmit.

Bit lumpy, but it ought to work.

Upvotes: 0

Related Questions