How to build Gstreamer for aarch64 Docker image?

126 views Asked by At

I am trying to build gstreamer for an app that will run on Axis IP cameras. The ACAP native SDK documentation has a docker toolchain to build and install the app.

I need to statically link the files that are built inside the Dockerfile. So, I am not sure if the route of apt-get install will work with it.

The documentation of the IP Camera SDK suggests building third party libraries and then including them in the build.

  • Architecture on which docker image is being built: Linux x86_64
  • Architecture on which the app will run: aarch64

Below is the code from the Dockerfile,

#-------------------------------------------------------------------------------
# Prepare build environment
#-------------------------------------------------------------------------------

# Install build dependencies for cross compiling OpenCV
RUN DEBIAN_FRONTEND=noninteractive \
    apt-get update && apt-get install -y -f --no-install-recommends \
    cmake python3 python3-dev python3-pip ninja-build && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN pip3 install meson

#-------------------------------------------------------------------------------
# Build Gstreamer libraries
#-------------------------------------------------------------------------------

ARG GST_DIR=${BUILD_DIR}
ARG GST_SRC_DIR=${GST_DIR}/gstreamer
ARG GST_BUILD_DIR=${GST_SRC_DIR}/build

WORKDIR ${GST_DIR}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git

WORKDIR ${GST_SRC_DIR}
RUN . /opt/axis/acapsdk/environment-setup* \
    && meson setup ${GST_BUILD_DIR} \
    && ninja -C ${GST_BUILD_DIR}

I use the following command to generate files that allow me to build meson for a different architecture.

docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes

However, while building, meson`` throws an error saying the host machine and the architecture being built for are not compatible.

It would be great if I could be guided in the right direction to properly compile and link the gstreamer library.

Thank you.

0

There are 0 answers