gstreamer-1.0 UDP receiver test pipeline - udp

I want to receive an UDP video stream with gstreamer. Well, the final goal is to play it into a QML page, which in turn use gstreamer as backend.
Thus, first I want to test at the low-level.
Opening the stream with VLC reveals:
MPEG-1/2 Video (mpgv)
720x576
50 fps
Planar 4:2:0 YUV
Because I'm running a custom Linux system I'm not sure if I have all the gstreamer plugins I need.
I have:
# gst-inspect-1.0 | grep mpeg2
libav: avenc_mpeg2video: libav MPEG-2 video encoder
libav: avdec_mpeg2video: libav MPEG-2 video decoder
omx: omxmpeg2videodec: OpenMAX MPEG2 Video Decoder
# gst-inspect-1.0 | grep udp
udp: udpsink: UDP packet sender
udp: multiudpsink: UDP packet sender
udp: dynudpsink: UDP packet sender
udp: udpsrc: UDP packet receiver
What is the minimum pipeline I can use to receive this UDP stream?

Related

Receive data array from Wifi with netcat and UDP

Trying to interface a device using Wifi to receive data array.
Netcat is used and set up as
UDP_IP='abc.def.c.cde"
UDP_PORT=53
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(UDP_IP, UDP_PORT)
dataarray,addr=sock.recvfrom(1024)
When I run, I have Permission denied error at sock.bind().
This UDP_IP='abc.def.c.cde" is taken from ifconfig for wifi.
But I don't know port number exactly.
How do i know port number for Wifi interface using UDP and Netcat?

How to create a video stream with Gstreamer without RTP?

I am trying to create a simple UDP video stream with Gstreamer1.0.
The problem is that for the purpose of my project I need to be able to have a vanilla UDP stream but almost all the tutorials I was able to find have RTP enabled.
So I would like to translate this simple stream:
Player:
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink
Server:
gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000
Can someone point me in the right direction on how to translate this simple example in UDP only?
The pipeline you stated above, at the sender's side I do not see any use of rtp. Ideally rtpjpegpay should have been used at the sender's side, which is then depayed at the receiver using rtpjpegdepay.
Have you tried the same pipelines, without UDP. It would complain you that the packet size at udpsink is more than the buffer. You will need rtpxpay to fragment the video stream into rtp packets.
In case you do not need rtp, try sending the stream directly but with a limit on the buffer size at the udpsink. This can also result in increased delay in rendering video, some packets getting lost, etc. Try experimenting with different values for the buffer sizes/packet size on udpsink. Unfortunately udpsink does not provide direct control on configuring these sizes. So you may have to find out other ways.

Set UDP port of VLC server for RTP streaming on Windows 10

I ran into an issue when streaming a video using RTP with VLC in Windows 10.
I have 2 laptops, one for streaming a short video using RTP over UDP and another one for receiving and displaying the video stream.
My concern is that I can stream to a given destination address and port e.g. 10.0.0.140:5006 but I cannot stream from the same port of a given address e.g. 10.0.0.130:5006. The server port (one the first laptop) has to be the same as the client port.
I followed a tutorial to stream a video using RTP / MPEG Transport Stream and I checked on Wireshark but I always have the streaming source port not set to 5006 as I wanted (Instead, it opens random server ports).
I checked on the internet for an answer to this but I found nothing helpful for my problem. I also checked in VLC preferences I set RTP port to 5006 but still the same behavior...
Does anyone know how to change udp server port of VLC to stream exclusively from port 5006 ?
Thanks!
I finally found out the solution by myself.
I did not set a static UDP server port, but I redirect the packets on postrouting using Ubuntu over a Virtual Machine.
To post-redirect the packets, I opened a terminal, and followed the two following steps:
Declare the wanted UDP port number in iptables
iptables -A OUTPUT -p udp --sport 5006 --dport 5006 -j ACCEPT
Redirect output data in nat's table to the previously declared UDP port number
iptables -t nat -A POSTROUTING -o eth0 -p udp -j SNAT --to :5006
This method allows to redirect any UDP packets output to source port 5006 before sending them on the network.

Stream webcam video with Gstreamer 1.0 over UDP to VLC player

I'm trying to stream a webcam video with gstreamer 1.0 over UDP. This is the command I used:
gstreamer-1.4.0$ gst-launch-1.0 -v v4l2src device=/dev/video1 ! "image/jpeg,width=1280, height=720,framerate=30/1" ! rtpjpegpay \ ! udpsink host = 10.234.2.65 port = 5000
I got receiving via VLC player working with gstreamer 0.1 using an sdp file as explained here.
How do I achieve the same with gstreamer 1.0?

IP camera with RTSP on the web, RED5 and ffmpeg

i have a ip camera with rtsp protocol and i want to stream on the web using flash video. I know i can use vlc but i do not want to use that.
I installed red5 and ffmpeg for convert RTSP to RTMP
ffmpeg -i "rtsp://46.13.85.43:8020/ch0.h264" -f flv -r 25 -s 640x480 -an "rtmp://localhost/live"
and result is: UDP timeout. retrying with TCP
Any idea where is the problem ?
You have to specify that tcp protocol is used, or at least that helped me. Please add this parameter -rtsp_transport tcp to your ffmpeg command.