-1

I want to stream a video over a network using UDP sink and src elements .

I am using the following:

  1. i.MX6Dual Processor as server

  2. x86 System as receiver with Ubuntu 18

  3. UVC Camera connected to i.MX6Dual Processor

When i run the gst pipeline, gst launch window pops up but video doesn't play it shows black screen.

Pipeline i used Server :

gst-launch-1.0 v4l2src ! videoconvert ! videoscale ! videorate ! "video/x-raw, width=720,height=576, format=I420, framerate=30" ! rtpvrawpay ! udpsink host=162.168.0.105 port=5000 sync=false

Receiver :

gst-launch-1.0 udpsrc port=5001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)720, height=(string)576, payload=(int)96, a-framerate=(string)30" ! rtpvrawdepay ! videoconvert ! queue ! xvimagesink sync=false

I tried to change some parameters like: resolution, framerate,etc but it didn't worked it showed black screen only. I also tried to remove the parameter but after removing parameters it didn't show gst launch window or any error.

I have checked the camera whether it takes input or not but it is working fine when I stream on local system.

Can you please help with the pipeline to stream a video and avoid black screen?

1 Answers1

0

When streaming video I recommend you encode your stream. This will reduce the size of your stream and allow for better performance, it is common practice. Here I have some server and receiver pipelines where I encode and decode my video. Both are running in my computer.

Server pipeline

gst-launch-1.0 -e -v v4l2src ! videoconvert ! videoscale ! videorate ! "video/x-raw,format=I420,width=640,height=480,framerate=30/1" ! x264enc key-int-max=15 ! rtph264pay ! udpsink host=localhost port=5000

In the previous pipeline, I keep the first elements you used. Then I used the x264enc element for H264 encoding. x264enc is an element from GStreamer that encodes by software, but since you are using an i.MX6 you can use a hardware accelerated encoder like vpuenc, you can look for more information in this link. Then the rtph264pay element to convert video/x-h264 into application/x-rtp. Finally, I specify my host address and port. I am using localhost since I am streaming in my PC.

Receiver pipeline

gst-launch-1.0 -v udpsrc uri=udp://localhost:5000 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! autovideosink

In this pipeline, I use the uri property to specify where is the stream coming from. You should change the address to IP of your server and the port to the one you specified in your server pipeline. Finally, you decode your video/x-h264 to video/x-raw with the avdec_h264 decoding element.

I hope this helps.

emurillo
  • 41
  • 3