GStreamer development in embedded with sbox2

I’ve heard many people having problems cross-compiling GStreamer on ARM systems so I decided to write a step-by-step guide describing how I do it.

This guide is meant for scratchbox 2. You can read this old post where I explain how to install it. I’m using CodeSourcery 2009q3 but any compiler would do.

Base

I’m going to install everything to “/opt/gst” on the build system, however this should go in the same directory in the target system.

So, in order for the packages to find each other:
export PKG_CONFIG_PATH=/opt/gst/lib/pkgconfig

glib

git clone git://git.gnome.org/glib
cd glib
git checkout -b stable 2.22.3
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst --disable-static --with-html-dir=/tmp/dump
sb2 make install

gstreamer

git clone git://anongit.freedesktop.org/gstreamer/gstreamer
cd gstreamer
git checkout -b stable RELEASE-0.10.25
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst --disable-nls --disable-static --enable-binary-registry --disable-loadsave --with-html-dir=/tmp/dump
sb2 make install

That’s it! You have a GStreamer development environment :)

Embedded stuff

If you are an embedded developer, chances are you would like to build gst-openmax or gst-dsp, or perhaps your own plugin. So here’s how to do it.

gst-openmax

git clone git://anongit.freedesktop.org/gstreamer/gst-openmax
cd gst-openmax
git checkout -b stable v0.10.0.5
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst
sb2 make install

gst-dsp

git clone git://github.com/felipec/gst-dsp.git
cd gst-dsp
git checkout -b stable v0.6.0
sb2 make

note: I forgot to add the install target, just copy the plugin

There. It’s easy to develop your own plugin this way, or contribute to the existing ones :) Note that as long as you are not using esoteric new API’s these binaries should work on any other GStreamer setups. I do this on my N900 for example, which has an older GStreamer, but I still test gst-dsp linked to a newer one.

Plugins

Perhaps you still don’t have GStreamer in your target environment so you want all the muxers, demuxers, and so on. So let’s build them.

Some plugins have dependencies; if you want them to be built, you would need to install them first.

liboil

gst-plugins-base needs liboil, so let’s start there.

git clone git://anongit.freedesktop.org/liboil
cd liboil
git checkout -b stable liboil-0.3.15
sb2 ./configure --prefix=/opt/gst --disable-static --with-html-dir=/tmp/dump
sb2 make install

gst-plugins-base

git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-base
cd gst-plugins-base
git checkout -b stable RELEASE-0.10.25
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst --disable-nls --disable-static --with-html-dir=/tmp/dump --disable-pango
sb2 make install

note: I’m disabling pango because a bug in the build system

gst-plugins-good

git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-good
cd gst-plugins-good
git checkout -b stable RELEASE-0.10.17
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst --disable-nls --disable-static --with-html-dir=/tmp/dump
sb2 make install

gst-plugins-ugly

git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-ugly
cd gst-plugins-ugly
git checkout -b stable RELEASE-0.10.13
./autogen.sh --noconfigure
sb2 ./configure --prefix=/opt/gst --disable-nls --disable-static --with-html-dir=/tmp/dump
sb2 make install

Conclusion

Not that hard, was it? Just copy all the binaries to your target system on ‘/opt/gst’ and fire up some ‘gst-launch’ commands :) Oh, wait, you’ll need to add /opt/gst/bin to your PATH. Or use sb2 to compile your own plugin and run on any system.

About these ads

35 thoughts on “GStreamer development in embedded with sbox2

  1. Hi Felipe,
    I cannot compile glib with sb2. When I run
    ./autogen.sh –noconfigure
    i got this error

    gio/Makefile.am: installing `./depcomp’
    configure: error: unrecognized option: `–noconfigure’
    Try `./configure –help’ for more information.

    So I modified autogen.sh and add exit 0 before it executes ./configure

    autoconf || exit $?
    cd $ORIGDIR || exit $?
    exit 0
    if test -z “$AUTOGEN_SUBDIR_MODE”; then
    $srcdir/configure –enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS “$@” || exit $?

    and run again ./autogen.sh

    but when i do
    sb2 ./configure –prefix=/opt/gst –disable-static –with-html-dir=/tmp/dump

    I got
    checking if building for some Win32 platform… no
    checking for thread implementation… posix

    and remains here forever…

    Could you give any hint to solve this??

  2. Thanks, changing the version worked fine, now I’m a able to compile gstreamer.

    I’m trying to reproduce first any sound on beagleboard. So the instruction which I’m using to do so is:

    sh-3.2# gst-launch-0.10 audiotestsrc ! audioconvert ! audioresample ! alsasink
    ERROR: pipeline could not be constructed: no element “audiotestsrc”.

    And when I execute
    sh-3.2# gst-inspect-0.10
    staticelements: bin: Generic bin
    staticelements: pipeline: Pipeline object

    Total count: 1 plugin, 2 features
    Do you know how many plugins are suppose to be available??

    Do you have some information that could help me to solve this?

  3. @Carlos I think that’s a question for the GStreamer mailing list. They’ll probably ask you where did you install your plugins, and which options did you use to compile.

  4. Hi,

    i have the same problems as Carlos!! with the older versions of glib

    I tried a new version of glib 2.23.3 and it show me:

    checking for unistd.h… yes
    checking for inflate in -lz… no
    configure: error: *** Working zlib library and headers not found ***

    i have all zlib-dev libraries installed but no
    change?!

    Can you give some help?!

  5. First of all, Thanks for sharing this usefull information.

    I am trying to use Gstreamer for mini2440 and using arm-linux-gcc-4.3.2.tgz as the cross compiler.

    I followed your other blog for scratchbox2 installation I made only changes in the cross compiler’s path.the changes are as below.

    cd /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/
    sb2-init -c /opt/qemu/bin/qemu-arm armv4t /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-gcc

    where ‘/usr/local/arm/’ is the path of cross compiler.

    Now when I cross compile Gstreamer,it is compiled using some different compiler.this is conclution I have drawn as we run gst-inspect I get the below message.
    [root@Hiteg bin]# ./gst-inspect
    Illegal instruction

    kindly help me fix this issue.

    Thanks,
    Ratheendran

  6. Hi ,

    I am also getting the same problem as Carlos and Michel.

    Can you give some help?

    Thanks in advance

  7. Everyone:

    Please make sure you copy the binaries to the same location in the target: /opt/gst

    @Michael If new versions of GLib don’t compile that’s a bug for GLib, but there must be a way you can cross-compile them and specify the location to the ‘configure’ script.

  8. Thank for your infomation. When I build glib follow your instruction, I get some error:
    >>/usr/local/arm/4.4.1/bin/arm-none-linux-gnueabi-ld: warning: libgthread-2.0.so.0, needed by ../gobject/.libs/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
    >>../gobject/.libs/libgobject-2.0.so: undefined reference to `g_thread_init’
    my configure is the same as you but I add option CPPFLAG and LDFLAG.
    Plz help me, sorry for my English.

  9. Thank you for tutorial, it was a huge help. I am able to build gstreamer, but it skips ximagesink and xvimagesink because it can’t find the X11 dev files. I have them and have tried setting CPPFLAGS but it still fails. Do I have to build X11 in the same way as Glib in the tutorial? Thanks in advance

  10. Thanks for the tutorial,this was indeed usefull

    I am presently working on OMAPL138 board,I am using “dvsdk_omapl138-evm_4_02_00_06_setuplinux” for the board.This has “gstreamer-ti_svnr919″ TI plugin source and is compiled with build system of the sdk.now I compiled other gstremer-plugins and make it with work with TI DSP codecs.

    can you tell me how this can be achieved,I am so far not able to put this together.

    Thanks in Advance,
    Ravi

  11. @Pete I guess so. I haven’t tried to build those plug-ins, but perhaps you only need to modify CFLAGS and LDFLAGS to find the right X11 dev files.

    @ravi I am sorry, I don’t know how to compile those plug-ins, maybe you can ask in the #gstreamer-ti IRC channel on Freenode.

  12. hi
    when i want compile glib and run
    ./autogen.sh –noconfigure
    it give me error:unrecognized option –noconfigure
    what i must do?
    also if i delete this option and run ./autogen.sh ,my system hangup in checking vs_list.

  13. checking whether I mean va_lists can be copied by value…yes
    I also after reboot computer because hang up,I use sb2 ./configure but it give me this error:
    ./libtool:cannot make pipe for command substitution: too many open files

  14. really I compile gstreamer and good base ugly plugins with other glib source but when i transfer all file with require library and change PKG_CONFIG_PATH to correct address and run qst-inspect and other gstremer files it give illegal command!!!
    i check gste-inspect with file command and it cross compiled for arm.
    BTW,in compiling plugin some Package cannot compile.

  15. Howdy very cool web site!! Guy .. Beautiful .. Wonderful .
    . I will bookmark your web site and take the feeds additionally?
    I’m happy to find numerous useful information right here in the put up, we want develop extra techniques in this regard, thank you for sharing. . . . . .

  16. Make positive to keep on to be present with the most up-to-date facts inside your industry.
    Just never be expecting accessibility to the Android Market.

  17. This should improve your credit score however, while you
    are still wondering how can i get a loan consolidation The answer isn’t quite that simple.

  18. Hi there all, here every person is sharing such familiarity, so it’s nice to read this webpage, and I used to go to see this website daily.

  19. whoah this weblog is magnificent i really like reading your articles.
    Stay up the great work! You understand, many people are hunting around for this
    information, you could aid them greatly.

  20. hi felipC,
    I followed your instructions along with one more blog> http://tordwessman.blogspot.in/2012/11/installing-gstreamer-10-from-source.html
    to cross compile gstreamer but the version is 1.0.2 for the beaglebone I’m able to cross compile but the outcome is this
    ———————————————————————————————-
    root@beaglebone:/# gst-inspect-1.0
    staticelements: bin: Generic bin
    staticelements: pipeline: Pipeline object

    Total count: 124 plugins (123 blacklist entries not shown), 2 features

    ———————————————————————————————-
    what may be the issue, any idea??
    thanks,
    aniket

  21. I drop a comment whenever I appreciate a article on a site or I have
    something to contribute to the discussion. It is a result of the sincerness communicated
    in the article I browsed. And on this post GStreamer development in embedded
    with sbox2 | Felipe Contreras. I was actually moved enough to post a
    thought ;-) I actually do have 2 questions for you if it’s okay.
    Is it only me or does it seem like some of these comments look as if they are coming from brain dead
    people? :-P And, if you are writing at additional places, I would like to keep up with everything fresh you have
    to post. Would you make a list all of all your public sites like
    your linkedin profile, Facebook page or twitter feed?

  22. This is really interesting, You’re a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking more of your
    fantastic post. Also, I’ve shared your web site in my social
    networks!

  23. Hmm it appears like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I
    submitted and say, I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m still new to everything.
    Do you have any points for beginner blog writers?
    I’d definitely appreciate it.

  24. Hey there I am so thrilled I found your blog, I really found you by accident, while
    I was researching on Bing for something else, Anyways I am here now and would just like to say
    thanks for a remarkable post and a all round entertaining blog (I also love the theme/design), I don’t have time to go through it all at the moment but I have book-marked it
    and also included your RSS feeds, so when I have time I will be back to read a great deal more,
    Please do keep up the fantastic job.

  25. I blog often and I truly appreciate your content.
    Your article has really peaqked my interest. I am going to book mark your website and keep checking
    for new detauls about once a week. I opted inn for your Feed aas well.

  26. Pingback: Predictional Logic in Programming? - Zurasky Gyan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s