3

I am going to use multiple clients on different computers to be able to view video of an IP Camera stream url. Because the Ip camera has limitations on the number of connected clients, I want to setup a streamer for this purpose. I googled and tried GStreamer with different command line options but not yet successful.

Here is a test command line:

gst-launch-1.0 rtspsrc location="rtsp://root:root@192.168.1.1/axis-media/media.amp?videocodec=h264&resolution=320x240&fps=10&compression=50" latency=10 ! rtph264depay ! h264parse ! tcpserversink host=127.0.0.1 port=5100 -e

But when I want to test it with vlc, nothing is played. Is it related to SDP? Does gstreamer can restream sdp from source?

After finding the correct command line, I want to integrate it into a c# application to automate this process.

Any help is welcome.

M.Mahdipour
  • 592
  • 1
  • 7
  • 21
  • Are you sure that `tcpserversink` is actually an RTSP server? Last time I've checked (about 1 or 2 years ago), there was no RTSP server implementations in GStreamer. The option that worked was implementing a server with the Live555 library. – Velkan May 23 '17 at 11:28
  • @Velkan Yes I have seen there have been implementations for RTSP Server in gstreamer, but I'm not sure if tcpserversink or udpsink also have rtsp server support. I have already used Live555 successfully, but it seems it has problems in large networks. I want to test gstreamer. – M.Mahdipour May 23 '17 at 12:10

2 Answers2

3

You need gst-rtsp-server. And to use it you have to write small C/C++ application - example here

upd: If your rtsp source provide h264 video stream you could use following pipeline to restream it without transcoding:

rtspsrc location=rtsp://example.com ! rtph264depay ! h264parse ! rtph264pay name=pay0 pt=96
RSATom
  • 817
  • 6
  • 16
  • I tested this sample in a c++ app with gstreamer libraries and dlls in Windows and it works. It displays test video source in vlc. But how can I connect an ip camera rtsp source to this streamer. I have tested this but not work. I replaced "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )" with "(rtspsrc location="rtsp://root:root@192.168.1.1/axis-media/media.amp?videocodec=h264&resolution=320x240&fps=10&compression=50" )" in the source. – M.Mahdipour May 25 '17 at 04:32
  • 1
    Thanks for your answers which guided me to the correct answer. Using rtspsrc is not enough. To use it, also must connect to pad-added signal, and use it to connect it to pipeline. This is a complicated process, and there is an alternative to it. I used GstRTSPMediaFactoryURI class which handles all and prepares and RTSP server ready to use. – M.Mahdipour May 27 '17 at 07:12
1

To re-stream h.264 video from IP camera, below is the Gstreamer pipeline (this works for me)

rtspsrc location=rtsp://IP_CAMERA_URL ! rtph264depay ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! yoursink

On gst-launch-1.0 --version ---> gst-launch-1.0 version 1.14.5 GStreamer 1.14.5

chintan-p-bhatt
  • 111
  • 1
  • 10