Using GStreamer on DIMM-MX53 under Linux

This is a list of examples on how you can use gstreamer with our boards. Please note that per default the digital camera input is used, if you want to use analog cameras, please contact emtrion support.

Hardware specific

To capture video from the camera, you can use the mfw_v4lsrc.

To encode the video using the hardware encoder, have a look at mfw_vpuencoder.

To display it on the screen, you can use the mfw_v4lsink.

Examples

The examples are tested on Lothrom 3/Verno 3 with Dimm-MX53 and a digital camera connected to the first input.

Files are stored to /mnt. If you want to, you can mount a NFS there or change the location.

Camera to display

Display what the camera sees on the screen. You can stop this with ctrl-c.

gst-launch mfw_v4lsrc capture-height=480 capture-width=640 ! mfw_v4lsink

Display a USB camera. It must be compatible to the linux UVC driver

gst-launch v4l2src device=/dev/video1 ! mfw_v4lsink

Camera to file

Take a single picture and store to /mnt.

gst-launch -e mfw_v4lsrc capture-height=480 capture-width=640 num-buffers=1 \ ! mfw_ipucsc \ ! jpegenc \ ! filesink location=/mnt/capture.jpeg

Capture an AVI with MJPEG in it. You can stop recording using ctrl-c and view this file on your PC using VLC.

gst-launch -e mfw_v4lsrc capture-height=480 capture-width=640 \ ! mfw_ipucsc \ ! mfw_vpuencoder codec-type=std_mjpg \ ! avimux \ ! filesink location=/mnt/capture.avi

Capture mp4 file using the hardware encoder:

gst-launch -e mfw_v4lsrc capture-height=480 capture-width=640 \ ! mfw_ipucsc \ ! queue \ ! "video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)30/1" \ ! mfw_vpuencoder codec-type=std_mpeg4 \ ! "video/mpeg, height=(int)480, width=(int)640, framerate=(fraction)30/1, mpegversion=(int)4, systemstream=(boolean)false" \ ! mp4mux \ ! filesink location=/mnt/capture.mp4

Camera to display and file

Use tee to split the video and display it on the screen while recording it to a file.

gst-launch -e mfw_v4lsrc capture-height=480 capture-width=640 \ ! tee name=camera \ ! queue leaky=downstream \ ! mfw_v4lsink \ camera. \ ! mfw_ipucsc \ ! queue \ ! "video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)30/1" \ ! mfw_vpuencoder codec-type=std_mpeg4 loopback=false \ ! "video/mpeg, height=(int)480, width=(int)640, framerate=(fraction)30/1, mpegversion=(int)4, systemstream=(boolean)false" \ ! mp4mux \ ! filesink location=/mnt/capture.mp4

File to display

Replay the film avi captured above:

gst-launch filesrc location=/mnt/capture.avi ! decodebin2 ! mfw_v4lsink

Replay the mp4 file:

gst-launch filesrc location=/mnt/capture.mp4 ! decodebin2 ! mfw_v4lsink



Back