I'm having some trouble figuring out how to create a simple rtp stream with gstreamer and display it on vlc.
I've installed GStreamer 0.10.30 and VLC 1.1.3. My only requirement is to use MPEG4 or H.264 codecs.
Right now, I can stream the GStreamer videotestsrc through this simple pipeline:
gst-launch videotestsrc ! ffenc_mpeg4 ! rtpmp4vpay ! udpsink host=127.0.0.1 port=5000
which outputs the "caps" needed by the client to receive the stream:
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335322e3132332e30, payload=(int)96, ssrc=(uint)365697461, clock-base=(uint)390754204, seqnum-base=(uint)10399
I'm also able to display the stream using the following pipeline:
gst-launch udpsrc uri=udp://127.0.0.1:5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d88007d0a041e1463000001b24c61766335322e3132332e30, payload=(int)96, ssrc=(uint)298758266, clock-base=(uint)3097828288, seqnum-base=(uint)63478" ! rtpmp4vdepay ! ffdec_mpeg4 ! autovideosink
but when I try to receive the stream with vlc:
vlc -vvv rtp://127.0.0.1:5000
I get nothing...
Since GStreamer can be used for network streaming, programs like VLC can be used to capture this media stream using a SDP file.
Enter the source party's IP address in the URL field for UDP/RTP Multicast streams and select "1234" as your Port. If receiving an HTTP/FTP/MMS or RTSP stream, enter the stream's URL in the URL field along with the IP address, the stream name and an ". sdp" file extension (e.g. xxx. xxx.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With