2
votes

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:[email protected]/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.

2
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
@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

2 Answers

3
votes

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
1
votes

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