GStreamer i.MX6 Camera Streaming

cancel
Showing results for 
Search instead for 
Did you mean: 

GStreamer i.MX6 Camera Streaming

GStreamer i.MX6 Camera Streaming

(DEPRECATED. Please check this document for Real Time Streaming)

A server can be streaming video and a client, in this case a i.MX6 target, is receiving and decoding it. For example, a server with GStreamer and a web camera connected, can be streaming with the following command:

$ # Pipeline 1

$ gst-launch v4l2src ! 'video/x-raw-yuv, format=(fourcc)I420, width=(int)1280, height=(int)800' ! ffenc_mpeg4 ! tcpserversink host=$CLIENT_IP port=$PORT

and on the target, the client receives, decodes and display with

$ # Pipeline 2

$ gst-launch tcpclientsrc host=$SERVER_IP port=$PORT  ! 'video/mpeg, width=(int)1280, height=(int)800, framerate=(fraction)10/1, mpegversion=(int)4, systemstream=(boolean)false' ! vpudec ! mfw_isink

The filter caps between the tcpclientsrc and the decoder (vpudec) depend on the sink caps coming from the server encoder (ffenc_mpeg4), so these may change depending on your needs. Running the above pipelines require the environment variables SERVER_IP, CLIENT_IP and PORT.

In case you want the i.MX6 to act as a server, just change the video source (either mfw_v4lsrc of v4l2src) and the encoder (vpuenc), so

$ # Pipeline 3

$  gst-launch v4l2src  !  'video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, interlaced=(boolean)false, framerate=(fraction)10/1'  ! vpuenc ! tcpserversink host=$CLIENT_IP port=$PORT


For testing purposes, set SERVER_IP=127.0.0.1, CLIENT_IP=127.0.0.1 and PORT=500, and run pipeline 3 and 2 in two different consoles. Check with 'top' the  CPU usage and see that VPU is actually doing most of the work.

Labels (3)
Comments

While working with a customer, we found that 1080p encode through the VPU doesn't work directly because of a test in src/video/vpu/src/vpuenc.c in the gst-fsl-plugins-3.0.2 package:

    if ((pad_width % 16) || (pad_height % 16)) {

Removing the restriction on pad_height seems to function.

There's also a way to use the mfw_ipucsc element to stretch things by 8 pixels.

Version history
Revision #:
1 of 1
Last update:
‎11-15-2012 03:44 PM
Updated by: