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

processing-video doesn't detect GStreamer files in sketch's code folder #204

Open
luiscastilho opened this issue Aug 23, 2022 · 4 comments

Comments

@luiscastilho
Copy link

luiscastilho commented Aug 23, 2022

Hello,

It used to be possible to copy the contents of processing-video library (Documents/Processing/libraries/video/library/*) to the code folder of a sketch and Processing would detect it there and be able to play videos, for example. Even if Documents/Processing/libraries was empty, no libraries installed there.

That doesn't work with the latest release of processing-video (release 9 or 2.1). Trying to run the Loop example this way, Processing prints these error messages:

We could not find a system-wide or bundled installation of GStreamer, but video might still work if GStreamer was placed somewhere else
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer
A library used by this sketch relies on native code that is not available.
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer

Not sure if it's an issue or if it's intended behavior, but it's a nice feature to be able to bundle all libraries needed by a sketch in the code folder. I use it as a way to "freeze" versions that work well with a sketch. Is it possible for processing-video to check if there's a code folder in the sketch folder and if needed GStreamer files are there?

For now I'm using the code below to get processing-video to locate Gstreamer inside code. I couldn't test this in Linux or macOS but it works well on Windows.

if ( PApplet.platform == WINDOWS )
  System.setProperty("gstreamer.library.path", sketchPath() + "/code/windows-amd64");
else if ( PApplet.platform == MACOS )
  System.setProperty("gstreamer.library.path", sketchPath() + "/code/macos-x86_64");
else if ( PApplet.platform == LINUX )
  System.setProperty("gstreamer.library.path", sketchPath() + "/code/linux-amd64");
System.setProperty("gstreamer.plugin.path", System.getProperty("gstreamer.library.path") + "/gstreamer-1.0");

Environment:

  • Processing version: 4.0.1
  • Operating System and OS version: Windows 10 Pro v21H2
  • Other information: processing-video release 9 (2.1) - library/* contents copied to sketch's code folder and library removed from Documents/Processing/libraries.
@luiscastilho
Copy link
Author

luiscastilho commented Aug 27, 2022

The workaround above doesn't work with release 10 (2.2). Works fine with release 9 (2.1), at least in Windows.

With release 10 I'm getting "failed to load plugin" errors, like the ones below. These DLL files are present in the location processing-video is checking, but for some reason it says the "module could not be found".

Seems like you are trying to use GStreamer native libraries older than 1.20, which are not supported.
Processing video library using bundled GStreamer 1.20.3
Scanning GStreamer plugins...
(Processing core video:11372): GStreamer-WARNING **: 15:54:38.639: Failed to load plugin 'C:\Users\Luis\Desktop\Loop\code\windows-amd64\gstreamer-1.0\gstaccurip.dll': The specified module could not be found.
This usually means Windows was unable to find a DLL dependency of the plugin. Please check that PATH is correct.
You can run 'dumpbin -dependents' (provided by the Visual Studio developer prompt) to list the DLL deps of any DLL.
There are also some third-party GUIs to list and debug DLL dependencies recursively.

(Processing core video:11372): GStreamer-WARNING **: 15:54:38.644: Failed to load plugin 'C:\Users\Luis\Desktop\Loop\code\windows-amd64\gstreamer-1.0\gstadder.dll': The specified module could not be found.
This usually means Windows was unable to find a DLL dependency of the plugin. Please check that PATH is correct.
You can run 'dumpbin -dependents' (provided by the Visual Studio developer prompt) to list the DLL deps of any DLL.
There are also some third-party GUIs to list and debug DLL dependencies recursively.

(Processing core video:11372): GStreamer-WARNING **: 15:54:38.649: Failed to load plugin 'C:\Users\Luis\Desktop\Loop\code\windows-amd64\gstreamer-1.0\gstadpcmdec.dll': The specified module could not be found.
This usually means Windows was unable to find a DLL dependency of the plugin. Please check that PATH is correct.
You can run 'dumpbin -dependents' (provided by the Visual Studio developer prompt) to list the DLL deps of any DLL.
There are also some third-party GUIs to list and debug DLL dependencies recursively.

...

@codeanticode
Copy link
Member

Do you have a other version of GStreamer installed on your computer?

@luiscastilho
Copy link
Author

No, I don't. In fact I have never installed GStreamer on my machine, so no chance of having left overs of a previous installation or anything like that.

And as I said the workaround I found was working with version 9/2.1 but stopped working with version 10/2.2. Not sure what changed.

@mike2moon
Copy link

mike2moon commented Jan 18, 2023

Spent some time looking for a solution for this and a user here said to set the system property manually to your gstream install, didnt say how, so i asked chatgtp and this line of code worked for me
System.setProperty("gstreamer.path", "C:\gstreamer\1.0\x86_64");
You will need to replace the path "C:\gstreamer\1.0\x86_64" with the actual path to your GStreamer installation.

Mine was "C:\gstreamer\1.0\msvc_x86_64" for example, the default after installing gstreamer from their website

It's important to note that the path must use double backslashes \ instead of single backslashes , as the single backslash is used as an escape character in Java strings. You cant see the double backslashes in the line of code I showed above but you need them in your code.

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

3 participants