Using local build with gstreamer-rs

Sebastian Dröge sebastian at centricular.com
Fri Jun 25 09:55:13 UTC 2021


On Fri, 2021-06-25 at 14:26 +0530, Samyak via gstreamer-devel wrote:
> Hey,
> Please let me know if this is the wrong place to ask questions or if
> my question has been answered before. 
> 
> My question is I want to use a newer version of gstreamer with
> gstreamer-rs. I am using gst-build to build a local version of
> gstreamer to build the master branch and I want gstreamer-rs to use
> that instead of using my global gstreamer which is on 1.18. 
> 
> To give some context around my reasoning to use the master branch
> (I'm giving this context so that I can get a better overall solution
> in case I'm taking the wrong approach here). I am using Arch Linux
> which means I'm using cuda 11.3.0-2. Based on this issue:
> https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1469
> , gstreamer 1.18 has issues with that. Because of this when I use
> gst-inspect, I don't get cudascale or any of the cuda functions. When
> I use gst-build to build the master branch, everything works when I
> try gst-launch. But I want to actually use the gstreamer-rs bindings.
> I have tried to clone the gstreamer-rs repo, and run the instructions
> from
> here: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/master/DEVELOPMENT.md
> and also set PKG_CONFIG env variable to the meson-private directory
> from the gst-build. I then compiled using the v1_20 feature on Cargo
> and the compilation worked. But, when I try using
> gst::ElementFactory::make("cudaupload", Some("cudaupoad"), I get this
> error: 
> BoolError { message: "Failed to create element from factory name",
> filename: "<home_dir>/Documents/projects/gstreamer-
> rs/gstreamer/src/auto/element_factory.rs", function:
> "gstreamer::auto::element_factory", line: 204 }', src/main.rs:10:82
> 
> Here's the full backtrace if that
> helps: https://pastebin.com/1U0qWWkH
> 
> Couple of questions on my end:
> 1. Do we know for a fact if gstreamer-rs is using my local build? How
> do I verify this? It seems weird that when I run the devenv on gst-
> build I am able to run cudascale with gst-launch but it does not seem
> to be working with gstreamer-rs.

Check the GStreamer debug logs. If you run with GST_DEBUG=6 you'll see
a lot of output, and especially at the beginning you'll see which
GStreamer version from where it is using and where it's trying to load
the plugins.
At the moment you're trying to create the element you should also see
something meaningful in the logs.

> 2. Am I writing the rust code wrong? Is elementfactory the wrong way
> to create cuda elements on Rust?

That's the correct way.

> 3. Is there any sample I can refer to so maybe I can try reverse
> engineering this? Or has gstreamer-rs never been tested with cuda
> support before?

I'm not aware of any CUDA example or anybody having used gstreamer-rs
with CUDA elements, but there's nothing special about the bindings in
that regard.
If it works with gst-launch then it will also work with the bindings as
long as the environment setup is the same.

-- 
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/20210625/5c71634a/attachment.htm>


More information about the gstreamer-devel mailing list