streaming video into a gstreamer rtsp server

11,335

Solution 1

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

Solution 2

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

Share:
11,335
Tal Darom
Author by

Tal Darom

Machine Learning/Deep Learning/Computer Vision + software engineering consultent also a Computer Vision PhD student at Bar-Ilan University, Israel.

Updated on June 04, 2022

Comments

  • Tal Darom
    Tal Darom almost 2 years

    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.