1

I have a server broadcasting the video generated by a USB webcam using GStream with the following gst-launch command:

 gst-launch-1.0 v4l2src ! video/x-raw,width=352,height=288 ! jpegenc! rtpjpegpay ! udpsink host=239.255.12.52 port=5004

Now i need a client to play that broadcast with VLC. I tried playing the following:

rtsp://239.255.12.52:5004

But I only get the following error:

SDP required:
A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (96).

Then i searched trying to find a sdp file that could help me play the stream. I tried this:

v=0 
c=IN IP4 239.255.12.52 
t=0 
m=video 5004 RTP/AVP 96 
a=rtpmap:96 JPEG/90000 

But it did'nt work. The vlc log just says:

es error: cannot peek
es error: cannot peek
...

I know the stream is working because i can use gstreamer to play it with the following command:

gst-launch-1.0 udpsrc uri="udp://239.255.12.52:5004" ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink

But i need it play with vlc not gstreamer. Any ideas? Thanks!!

DaveCode
  • 73
  • 2
  • 2
  • 5
  • this is not rtsp but rtp stream.. but you can store the metadata in mpeg ts and thus no need for sdp - check [this](http://stackoverflow.com/a/35148868/3876138) answer.. but you need to use h264 .. then you would open in vlc `udp://@239.255.12.52:5004` – nayana Jul 04 '16 at 13:08
  • Hi @otopolsky! I did also try to play the stream using rtp://239.255.12.52:5004. It did not work either. The problem is that using h264 as we discussed in the answer you mention does produce a 2-3 second delay in the stream that is not acceptable. I found that using gstreamer and using a mjpeg stream i got a less than a second delay with the camera. But that was if i used a gst-launch command to play that stream on the client side. Which i cannot use. Is not possible to play the stream with vlc if i use mjpeg? Thanks! – DaveCode Jul 04 '16 at 13:55
  • you need proper sdp file and it should work - if you have doubpts save the gstreamer pipe into file (mux it in mp4 and to filesrc) and check if its playable in vlc.. and its rtp.. rtsp is much complicated and you would need to have rtsp server (there is gstreamer variant [here](https://gstreamer.freedesktop.org/modules/gst-rtsp-server.html) ) .. – nayana Jul 06 '16 at 07:24
  • Looks like you are missing the origin field 'o=...' field on your sdp file – lnogueir Feb 27 '21 at 21:23

1 Answers1

0

How about this approach:

server (gstreamer):

gst-launch-1.0 v4l2src ! image/jpeg,width=1280,height=720 ! tcpserversink host=###.###.###.###

client (vlc):

tcp://###.###.###.###:4953

Also, in vlc gui, set caching to 0 ms. (:network-caching=0)

In this approach, there's no extra encode (jpegenc not needed) on the server side because the camera itself can produce .jpg images (this is common with web cameras). Also no muxing needed.

On the client side, the latency is minimal.

It's not multicast, but maybe that's ok for you?

helloflow
  • 9
  • 2