Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributing GStreamer with an application using this library (some elements not found) #20

Closed
NoTuxNoBux opened this issue Feb 9, 2021 · 2 comments

Comments

@NoTuxNoBux
Copy link
Contributor

I'm trying to get the plugin to work with a standalone version of GStreamer, or, in other words, trying to distribute GStreamer with my application, as I won't be able to modify the PATH variable on the target system.

I've built the DLL myself using Visual Studio 2019 and GStreamer 1.18 (tried both the MSVC and MinGW64 versions), and I can get the first test scene with videotestsrc to work properly. I needed to configure GST_PLUGIN_PATH in order for GStreamer to use the path inside my application for this, which works great.

Strangely enough, most other elements I try to use - including udpsrc used by the second scene - will show an error no element "udpsrc". When I enable verbose debugging, I see tons of errors where GStreamer picks up the DLLs that carry these elements correctly from the folder I have configured, but it then refuses to load them, without more information:

0:00:00.333836500 24412 0000025FAF9DB000 DEBUG           GST_REGISTRY gstregistry.c:1361:gst_registry_scan_path_level:<registry0> file C:\mrayGStreamerUnity\Unity\UnityTests\Assets\Plugins\x86_64\lib\gstreamer-1.0\libgstrtpmanagerbad.dll not yet in registry
0:00:00.333870500 24412 0000025FAF9DB000 DEBUG     GST_PLUGIN_LOADING gstplugin.c:768:_priv_gst_plugin_load_file_for_registry: attempt to load plugin "C:\mrayGStreamerUnity\Unity\UnityTests\Assets\Plugins\x86_64\lib\gstreamer-1.0\libgstrtpmanagerbad.dll"
0:00:00.334772100 24412 0000025FAF9DB000 WARN      GST_PLUGIN_LOADING gstplugin.c:806:_priv_gst_plugin_load_file_for_registry: module_open failed: 'C:\mrayGStreamerUnity\Unity\UnityTests\Assets\Plugins\x86_64\lib\gstreamer-1.0\libgstrtpmanagerbad.dll': The specified module could not be found.

(Unity.exe:24412): GStreamer-WARNING **: 17:32:40.342: Failed to load plugin 'C:\mrayGStreamerUnity\Unity\UnityTests\Assets\Plugins\x86_64\lib\gstreamer-1.0\libgstrtpmanagerbad.dll': 'C:\mrayGStreamerUnity\Unity\UnityTests\Assets\Plugins\x86_64\lib\gstreamer-1.0\libgstrtpmanagerbad.dll': The specified module could not be found.

The strange thing is that this only happens in Unity: all these elements work completely fine using gst-launch-1.0 shipped with the same binary. I also don't understand why it's just these that don't work.

I've tried using dependency walker to figure out if certain DLLs are missing on my system, but no missing DLLs appear.

I've also tried to set the GST_PLUGIN_PATH to the default GStreamer installation, to see if it needed some files that it was missing, but it results in the same errors.

@mrayy
Copy link
Owner

mrayy commented Feb 10, 2021

GStreamer relies on modules that are loaded at run time for the plugins. According to the log you posted some of these plugins were not found or their dependencies are messing. You will need to use a dependency walker to get the missing dlls and then place them next to the other dlls

@NoTuxNoBux
Copy link
Contributor Author

NoTuxNoBux commented Feb 10, 2021

Turns out that the bin DLLs were at the right place for GStreamerUnityPlugin.dll to find them, and the plugins were also scanned, but the other not-yet-loaded DLLs from the bin folder were not loaded as necessary when the plugins were loaded (because they couldn't be found). After fixing that, the udpsrc works.

I can now get this to work in both the Unity Editor and a standalone build. Thanks for the assistance!

In case anyone's wondering: you can set the PATH variable programmatically in Unity and point it to the GStreamer DLLs and then put the necessary GStreamer setup in StreamingAssets in order to get them copied to the output folder. This seems to work for stand-alone builds. In UWP the situation appears to be more complex (but that's being discussed in #15).

@NoTuxNoBux NoTuxNoBux changed the title Distributing GStreamer with an application that using this library (some elements not found) Distributing GStreamer with an application using this library (some elements not found) Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants