Cross-compiling GStreamer for Raspberry Pi

I would like to build GStreamer for my Raspberry PI on my main computer (Linux x86). Building from source on the Raspberry Pi takes very long, not very efficient. I tried to follow the steps in this blog post Cross-compiling with gst-build and GStreamer but it seems that the gst-build repo is now archived. What does that mean? Could anyone provide any pointers for a more recent way of cross compilation GStreamer?

Gstreamer repos have all been merged into the main GStreamer repository, see: GStreamer mono repository FAQ for more information.

I’m now trying to cross-compile using GStreamer / cerbero · GitLab that is the recommended way, right?

Same steps should still apply. Small tip, make to use a debian docker or installed OS that matches the target debian used, so that you don’t endup with mixed toolchains.

1 Like

Thank you for the tip @ndufresne , I’m doing exactly that.

I’m stuck in this error:

Found pkg-config: /root/cerbero/build/build-tools/bin/pkg-config (0.29.2)
WARNING: Found CMake '/usr/bin/false' but couldn't run it
Found CMake: NO
Run-time dependency libdrm found: NO (tried pkgconfig and cmake)
Run-time dependency x11 found: NO (tried pkgconfig)

../ ERROR: Dependency "x11" not found, tried pkgconfig

A full log can be found at /root/cerbero/build/sources/linux_arm/gstreamer-1.0/subprojects/gst-plugins-base/_builddir/meson-logs/meson-log.txt

Recipe 'gst-plugins-base-1.0' failed at the build step 'configure'
Command Error: Running ['/root/cerbero/build/build-tools/bin/meson', 'setup', '--prefix=/root/cerbero/build/dist/linux_arm', '--libdir=lib/arm-linux-gnueabi', '-Ddebug=true', '--default-library=both', '-Doptimization=2', '--backend=ninja', '--wrap-mode=nodownload', '-Dpkgconfig.relocatable=true', '--cross-file', '/root/cerbero/build/sources/linux_arm/gstreamer-1.0/subprojects/gst-plugins-base/_builddir/meson-cross-file.txt', '--native-file', '/root/cerbero/build/sources/linux_arm/gstreamer-1.0/subprojects/gst-plugins-base/_builddir/meson-native-file.txt', '-Dgl=enabled', '-Dgl-graphene=enabled', '-Dgl-png=enabled', '-Dgl-jpeg=enabled', '-Dogg=enabled', '-Dopus=enabled', '-Dpango=enabled', '-Dtheora=enabled', '-Dvorbis=enabled', '-Dtremor=disabled', '-Dcdparanoia=enabled', '-Dx11=enabled', '-Dxvideo=enabled', '-Dalsa=enabled', '-Dintrospection=disabled', '-Dexamples=disabled'] returned 1
Output in logfile /root/cerbero/build/logs/linux_arm/gst-plugins-base-1.0-configure.log
Select an action to proceed:
[0] Enter the shell
[1] Rebuild the recipe from scratch
[2] Rebuild starting from the failed step
[3] Skip recipe
[4] Abort

I did run the bootstrap command for this config:

./cerbero-uninstalled -c config/cross-lin-armv6.cbc bootstrap

The config config/cross-lin-armv6.cbc contents:

import os
from cerbero.config import Platform, Architecture, Distro, DistroVersion

target_platform = Platform.LINUX
target_distro = Distro.DEBIAN
target_arch = Architecture.ARM
variants.override(['noalsa', 'nopulse', 'nocdparanoia', 'nosdl', 'nogl',
                   'notestspackage', 'nopython'])

I checked that the system bootstrap is installing all the necessary packages (in cerbero/bootstrap/ so I don’t understand why it would be failing.

I went brute-force mode, edited manually some files like the `` to remove the gl, alsa, that were failing for me. Also edited the various recipes to build the good, bad, ugly set of plugins, disabling all that failed to build due to missing dependencies.

I’ve managed to successfully build most of the elements and the ones that I actually wanted. :sweat_smile: Not clean, but worked! :face_with_peeking_eye:

1 Like

I would have sticked with meson build and a cross file, setting custom rootfs and toolchains in cerbero is actually much harder.

You might want to read this:

And then this article (which should really go into the official doc when someone finds time)