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.
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??
@carlos Sorry, I forgot to mention that that version of qemu has that exact problem. Please try a newer one.
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?
@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.
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?!
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
Hi ,
I am also getting the same problem as Carlos and Michel.
Can you give some help?
Thanks in advance
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.
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.
still having this issue… with the zlib libraries
did anyone get this solved?
@jim, @michael: That’s a bug in GLib for which I have provided the patches but Matthias Clasen has neglected to apply them.
https://bugzilla.gnome.org/show_bug.cgi?id=623473
https://bugzilla.gnome.org/show_bug.cgi?id=630910
You can follow this instead:
http://felipec.wordpress.com/2010/10/08/my-arm-development-notes/
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
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
@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.
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.
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
Hi
I want to know how change CFLAGS and LDFLAGS to solve X11 problem?
@mehdi Can you please be more specific about what are your problems?
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.
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. . . . . .
Hi, just wanted to say, I loved this blog post.
It was practical. Keep on posting!