I am trying to open a gstreamer pipeline from the drone started using the command provided in the wiki here https://github.com/intel-aero/meta-intel-aero/wiki/06-Cameras-and-Video# network-streaming-with-gstreamer 06 Cameras and Video · intel-aero/meta-intel-aero Wiki · GitHub :
sudo gst-launch-1.0 v4l2src device=/dev/video13 do-timestamp=true ! video/x-raw, format=YUY2, width=640, height=480, framerate=15/1 ! autovideoconvert ! vaapih264enc ! rtph264pay ! udpsink host=192.168.1.147 port=5600
How can I open this stream on my remote computer (located at the ip address specified in the command above)?
After much experimentation I have discovered the following pipelines which seem to work:
On the Aero:
sudo gst-launch-1.0 -v v4l2src device=/dev/video13 ! video/x-raw,width=640,height=480,framerate=30/1 ! queue ! autovideoconvert ! vaapih264enc bitrate=500 ! rtph264pay ! udpsink host=172.16.0.126 port=5000
On the remote computer viewing the video stream (ip address 172.16.0.126):
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
While this works, there is a 2 second or so lag in the video footage. On a separate Aero drone running Ubuntu I was able to try a different h264 encoder and saw the latency drop dramatically. Unfortunately I have not been able to add packages to Yocto so this is not an option when running this OS. Here is the command with the different encoder:
sudo gst-launch-1.0 -v v4l2src device=/dev/video13 ! video/x-raw,width=640,height=480,framerate=30/1 ! queue ! autovideoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=172.16.0.126 port=5000
Is there any way we could get the x264 encoder running on Yocto instead of the vaapih264 encoder? Thank you for your help.
We didn't try to add the x264 encoder onto the Yocto image.
You can try to create custom image and add the x264 recipe found in the link below.
You should share your results with the community.