Cross compile Gstreamer application on Ubuntu host for imx6 target board

Hi Toradex Team,

I am new to imx6 and embedded linux. I want to develop GStreamer applications that can be run on imx6 target device. So far, I have used Gstreamer tools like gst-launch-1.0 and imx plugins using the command line on imx6 target device.
eg:

gst-launch-1.0 –v videotestsrc pattern=18 ! video/x-raw,width=100,height=50 ! 
imxvpuenc_h264 bitrate=500 ! h264parse ! rtph264pay ! udpsink host=10.0.5.1 port=5000

I want to develop a C application now on my Ubuntu 18.04 PC that corresponds to the above command-line pipeline , and then cross compile this application for the imx6 board. Later I want to use pscp to transfer this executable on the board and run the executable on the board.

Could you let me know how to do this? Which toolchains should I install for this ? I would prefer doing it via normal makefiles rather than using eclipse. But if using eclipse is easier, than I can try that as well. Also I do not want to change the kernel on my target board. I want to develop this application that is capable of running on imx6 board, running any linux flavours(ofcourse with the gstreamer-imx plugins). Is that possible?
Could you please guide me on this?

PS: I am using apalis imx6 carrier board and evaluation board.

hi @soc_learner

During the Getting Started of Apalis imx6, the setting of cross compiler toolchain is explained and how you can copy the your compiled software to the module.
Regarding the gstreamer librariers, you should do the Openembedded build and create your own SDK as mentioned here.

Feel free to ask, if you have more questions.

Hi Jaski,

Thanks for the update. As the first step, I created the SDK as described here with the yocto packages using 'bitbake <image> -c populate_sdk ' .

With this I created a ‘hello world’ program and was able to run it on the imx6 target. However, I still do not clearly understand how to get the GStreamer application code working on imx6 target. For eg, I took one of the basic examples from the GStreamer official website and compiled it as :

$CC basic-tutorial-12.c -o basic-12 `pkg-config --cflags --libs gstreamer-1.0` 

However, this compilation failed, saying ’ basic-tutorial-12.c command not found’
I understand that I am missing out the imx and gstreamer libraries. But I have no idea how to include it, since I am a beginner to embedded linux. Also when I start using imx-elements like ‘mxvpuenc_h264’ or ‘h264parse’ . How should I compile the code?

It seems that your compiler is not set as explained here.

Thanks. I got it!!

You are welcome.