Reputation: 247
How do you send a udp video stream to a port using gstreamer on windows?
I would like to send the testvideo to a specific port but nothing is being output when I check the network using wireshark. Here is what I have tried as a gstreamer pipeline.
gst-launch-1.0 -v videotestsrc ! x264enc ! rtph264depay ! upsink port=3445
Here is the output in the command prompt terminal.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING...
Redistribute latency ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New Clock: GstSystemClock
Wireshark shows no output on the network.
Upvotes: 2
Views: 10532
Reputation: 1794
You need to use rtph264pay
element for payloading instead of rtph264depay
, and you need to define a targed ip address for udpsink
. It is also good idea to add caps to x264enc
stating it will output a byte-stream
.
A sample pipeline I recommend is as follows. Feel free to replace 127.0.0.1
with your target.
gst-launch-1.0 -v videotestsrc ! x264enc ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264depay ! udpsink port=3445 host=127.0.0.1
A word on h264parse
, in older versions of gstreamer you need this element, in the newer versions you don't need to use this one.
Upvotes: 1
Reputation: 104
Before introducing advanced elements, let's start by simple consistency-check as below (Ubuntu 18.04 LTS):
Send udp stream:
gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay ! udpsink port=3445 host=ip_address
Receive udp stream (Receiving would takes few second to display):
gst-launch-1.0 udpsrc port=3445 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
If nothing display, try to remove vaapi:
sudo apt-get remove gstreamer1.0-vaapi
Let us know if it works (thumb-up) or doesn't work (thumb-down) !
Upvotes: 0