Rust gstreamer-full / static build

Mattias Nordstrom mnordstr at gmail.com
Mon Dec 5 15:37:18 UTC 2022


The application is written in Rust and using the gstreamer, gstreamer-base
and gstreamer-app crates. Building and running against the installed
GStreamer (and devel) .msi works as expected. I'm using the
d3d11screencapturesrc, mfg264enc and appsink elements in my pipeline. I've
tried to build GStreamer from source "meson --default-library=static ...."
and it builds and creates a gstreamer-full-1.0.lib which I assume I should
be able to use for the static linking into my app. The Rust crates however
still seem to be trying to link against e.g. gobject-2.0 etc. and not
gstreamer-full-1.0. I've changed the PKG_CONFIG_PATH env variable to my
custom build pkgconfig path and it seems to be using that but still trying
to link against the individual libraries that the static full build doesn't
even produce.

I also tried to statically link against the official .msi install using the
env variable SYSTEM_DEPS_LINK = "static" but that didn't seem to do
anything.

On Mon, Dec 5, 2022 at 11:05 AM Sebastian Dröge <sebastian at centricular.com>
wrote:

> On Sun, 2022-12-04 at 15:52 +0200, Mattias Nordstrom via gstreamer-devel
> wrote:
>
>
> I'm trying to make a small self contained binary in Rust using GStreamer
> and a couple of plugins. Can the Rust bindings already somehow utilize a
> gstreamer-full static compilation? If not, are there any other ways to make
> a self-contained binary that is smallish? Primary target is Windows.
>
>
> Theoretically this works, but there seems to be a bug currently that
> prevents it from working successfully with gobject-introspection:
>     https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/262
> I think if you disable gobject-introspection then it will work correctly.
>
> If I understand you correctly, you're writing your application in Rust? In
> that case you can directly depend on the Rust plugins in your Cargo.toml
> and statically link them that way, which depending on the plugin also gives
> you direct access to some more API (e.g. enum types).
>
>
> --
>
> Sebastian Dröge, Centricular Ltd · https://www.centricular.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20221205/630d9c82/attachment-0001.htm>


More information about the gstreamer-devel mailing list