Surveillance

In recent years, use of cameras in embedded systems has grown tremendously. They are used in different embedded devices like:

  • Medical Diagnostics devices
  • Security devices
  • Traffic monitoring devices

This blog explores various frameworks available on eSOMiMX6 device to quickly develop a USB camera streaming application. The following frameworks are readily available in eSOMiMX6 devices to quickly develop camera streaming applications:

  • Gstreamer
  • Qt-Multimedia
  • Qt-Gstreamer

GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. GStreamer provides application’s multimedia service such as video editors, media streaming and media players.

To work with Webcam using gstreamer, we need to use Video4Linux (V4l2) driver input – v4l2src. Video4Linux is an API and driver framework to capture and playback from video devices. It supports several types of USB cameras and other devices. v4l2src is an element of the plugin Video4Linux2. v4l2src can read frames from a webcam.

The following command streams frames from a attached webcam:

gst-launch-1.0 v4l2src device="/dev/video0" ! autovideosink

eSOMiMX6 root file system is already packed with gstreamer0.10 and various plugins required to develop camera streaming applications.

Qt Multimedia is an essential module that provides a set of QML types and C++ classes to handle the multimedia contents. It provides APIs to access the camera functionalities. The following snippet streams from the attached webcam:

Camera {
         id: camera
 
         onError: {
             console.log("CAMERA ERR: " + errorCode + " " + errorString)
         }
 
    }
 
     VideoOutput {
         id: previewArea
         source: camera
         fillMode: VideoOutput.PreserveAspectCrop
         anchors.fill: parent
     }

eSOMiMX6 root file system is already packed with latest Qt modules required to develop camera streaming applications.QtGStreamer is a set of libraries providing C++ bindings for GStreamer with a Qt-style API, plus some helper classes and elements for integrating GStreamer better in Qt applications. After implementing the pipeline in C++, the below snippet can stream a webcam :

    VideoItem {

        id: videoSurface
        y: Screen.height * 0.1
        width: Screen.width * 0.75
        height: Screen.height * 0.9
        surface: videoSurface1
    }

We’ve already developed a full fledged camera applications using Qt and Qt-Gstreamer frameworks. Both the applications supports following features:

  • Streaming
  • Capture image
  • Image gallery

Please visit our developer website to download camera applications with source code.

Are you looking to quickly develop a streaming application using Qt? Then, the e-con Systems™ eSOMiMX6 based Ankaa kit might be a good solution for you.

For further assistance and queries please get in touch with sales@e-consystems.com