GStreamer Creating C Code applications

From RidgeRun Developer Wiki


Problems running the pipelines shown on this page?
Please see our GStreamer Debugging guide for help.

GStreamer C Code Application

The gst-launch test utility is handy for verifying a GStreamer pipeline is setup correctly. However gst-launch is not a good choice to use in a shipping embedded Linux product. Instead, a GStreamer application is needed. One choice is to use GStreamer Deamon, which you can control using D-Bus. Another option is to role your own application.

This wiki documents how to create a GStreamer C code application using the Ridgerun's SDK. The applications is located in $(DEVDIR)/myapps, uses the Ridgerun classes for GStreamer, autotools, and general sdk installation into target. Like all GStreamer C code application, the application uses glib. The example application was tested using the Turrialba SDK running on a Leopardboard368 using a MT9P031 Aptina sensor.

The example application can be better understood by referring to the GStreamer documentation.

The source code to the GStreamer C code application can be retrieved using:

git clone https://github.com/RidgeRun/video-capture-application.git video-capture-application

GStreamer applications can have parsers, callbacks according to signals, read values from command lines and many other capabilities. In this case this is just a simple application that runs the following pipeline:

videotestsrc num-buffers=300 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640, height=480' ! dmaiaccel ! dmaienc_h264 ! queue ! qtmux ! filesink location=$FILENAME

where the FILENAME is the first command line parameter.

Application source code directory structure

video_capture_application/
├── Config
├── Makefile
└── src
         ├── autogen.sh
         ├── configure.ac
         ├── Makefile.am
         ├── README
         └── src

                  ├── Makefile.am
                  ├── video_capture_application.c
                  └── video_capture.h

Compiling Application

ARM Compilation

The RidgeRun SDK makes it easy to cross compile for the ARM:

cd $DEVDIR/myapps
git clone https://github.com/RidgeRun/video-capture-application.git video-capture-application
cd video-capture-application
make

When the application is installed it can be run at the target with the following command:

video_capture_application test_file.mov

After 300 frames have been processed, the file test_file.mov will contain the video.

x86 Compilation

You doin't need the RidgeRun SDK to build for the host. You do need GStreamer development libraries installed.

cd $HOME/work
git clone https://github.com/RidgeRun/video-capture-application.git video-capture-application
cd video-capture-application/src
./autogen.sh
./configure
make

After compiling the application can be executed as any regular binary:

./video-capture-application video_test.mov

After 300 frames have been processed, the file test_file.mov will contain the video.


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us
RidgeRun.ai: Artificial Intelligence | Generative AI | Machine Learning

Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page.