H.264 Video Streaming over Network

The Gateworks Ventana Family of Single Board Computers is well suited for multimedia applications. The Freescale i.MX6 processor has hardware encoding and decoding making for very little processor overhead. To take advantage of this hardware decoding it is important to always use the ‘vpuenc’ and ‘vpudec’ gstreamer pipeline elements.

  • vpuenc – VPU (Video Processing Unit) encoder
  • vpudec – VPU (Video Processing Unit) decoder

It is also important to use a high compression video format such as H.264 which uses significantly less network bandwidth while retaining good quality. To use this, we encode by using the following pipeline element:

  • vpuenc codec=avc

When streaming over the network, TCP is a reliable protocol but often too stringent for video applications. UDP is often preferred so that even if packets are lost, the stream will continue without waiting for the lost packet. To use UDP, we use the udpsrc and udpsink pipeline elements.

Here is an example pipeline to stream live video over the network using two Ventana Single Board Computers. Be sure the two single board computers are on the same network and can ping each other. Both should also be running OpenEmbedded Yocto operating system. An analog video camera is connected to the video input on a Ventana board. Another Ventana board is connected to a HDMI monitor.

Start the server board pipeline first: (board with HDMI monitor connected)

root@ventana:~# gst-launch udpsrc port=9001 ! h264parse ! queue max-size-time=0 max-size-buffers=0 ! vpudec low-latency=true frame-plus=1 framedrop=false ! mfw_v4lsink sync=false async=false

Then start the client pipeline (board with analog video camera connected)

root@ventana:~# gst-launch tvsrc device=/dev/video0 ! vpuenc codec=avc ! udpsink host=192.168.1.2 port=9001 sync=false async=false

For more information, please view our GStreamer Software Wiki here: http://trac.gateworks.com/wiki/Yocto/gstreamer