GStreamer rtp stream to vlc

Solution 1:

I've solved the issue, it just needs an sdp file like this:

v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 MP4V-ES/90000

and the option "send-config=true" for the rtpmp4vpay element:

gst-launch videotestsrc ! ffenc_mpeg4 ! rtpmp4vpay send-config=true ! udpsink host=127.0.0.1 port=5000

and then, it can be played with

vlc <filename>.sdp

Solution 2:

How to for H264 and new gstreamer (windows)

gst-launch-1.0 videotestsrc ! openh264enc ! rtph264pay config-interval=10 pt=96 ! udpsink host=127.0.0.1 port=5000

sdp file:

v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 H264/90000

for other codec see https://en.wikipedia.org/wiki/RTP_audio_video_profile and corresponding SDP example in RFC link

Solution 3:

For some of you just check the answers, but not comments below the answers

For GStreamer 1.18.xxx. ffenc_mpeg4 was renamed to avenc_mpeg4(This confuses me alot) So try command:

gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay config-interval=1 ! udpsink host=127.0.0.1 port=5000

About VLC same as Dave's answer