Having trouble loading a simple video

Windows 10.
Processing 4.3.
Video Library for Processing 2.2.2.
Movie file is in the same folder as Sketch.
I was just fine with my current project (that manipulates images, but I want to extend it to load videos as well). Then I started to have problems. I isolated the matter in a simple sketch to find out what’s happening:

import processing.video.*;

Movie movie;

void setup() {
  size(640, 360);
  movie = new Movie(this, "skull.mov");
  movie.loop();
}

void draw() {
  if (movie.available()) {
    movie.read();
  }
  image(movie, 0, 0);
}

The successive errors in the console look like this:

can’t load library avcodec-58 (avcodec-58|libavcodec-58|libavcodec-58-0) with -Djna.library.path=C:\gstreamer\1.0\msvc_x86_64\bin. Last error:java.lang.UnsatisfiedLinkError: Unable to load library ‘avcodec-58’:

Native library (win32-x86-64/avcodec-58.dll) not found in resource path (C:\Users\USURIO~2\AppData\Local\Temp\processing\video4542666899935926567temp;C:\processing-4.3\core\library\core.jar;C:\processing-4.3\core\library\gluegen-rt.jar;C:\processing-4.3\core\library\jogl-all.jar;C:\Users\Usuário\Documents\Processing\libraries\video\library\gst1-java-core-1.4.0.jar;C:\Users\Usuário\Documents\Processing\libraries\video\library\jna.jar;C:\Users\Usuário\Documents\Processing\libraries\video\library\video.jar)
can’t load library avfilter-7 (avfilter-7|libavfilter-7|libavfilter-7-0) with -Djna.library.path=C:\gstreamer\1.0\msvc_x86_64\bin. Last error:java.lang.UnsatisfiedLinkError: Unable to load library ‘avfilter-7’:

And so on.
I’ve tried lots of different things (asked Claude and ChatGPT for solutions) but for the life of me I can’t load a simple video.

Can somebody help? It’s an important project.
Thanks in advance

Hello @cyber.mirror.channel,

It worked if I only used the GStreamer that comes with the Processing video library

If you have GStreamer installed elsewhere rename the folder (just add any character to it) so it is not used.

I did the above and it worked with a mov video file.

:)

Thanks for the reply. There has been indeed an advance, I did what you said and is started to search in the right place. But still doesn’t work, there’s another error now.

Processing video library using bundled GStreamer 1.20.3
Scanning GStreamer plugins…
(Processing core video:5104): GLib-CRITICAL **: 07:56:27.136: g_dir_open_with_errno: assertion ‘wpath != NULL’ failed
Cannot load GStreamer plugins from C:\Users\Usuário\Documents\Processing\libraries\video\library\windows-amd64\gstreamer-1.0
RuntimeException: Could not load movie file skull.mov
RuntimeException: Could not load movie file skull.mov
RuntimeException: Could not load movie file skull.mov
Could not run the sketch (Target VM failed to initialize).

I double checked all paths, for the video file and for the gstreamer library, they’re all in place. Any ideas? Thanks again!

I have updated my code with a some lines for debugging and done as you said for it to load Processing’s native gstreamer library. Now the error looks like this:

Processing video library using bundled GStreamer 1.20.3
Scanning GStreamer plugins…
(Processing core video:9648): GLib-CRITICAL **: 09:18:42.129: g_dir_open_with_errno: assertion ‘wpath != NULL’ failed
Cannot load GStreamer plugins from C:\Users\Usuário\Documents\Processing\libraries\video\library\windows-amd64\gstreamer-1.0
Error loading movie: Could not load movie file skull.mov
java.lang.RuntimeException: Could not load movie file skull.mov
at processing.core.PApplet.die(PApplet.java:3330)
at processing.core.PApplet.die(PApplet.java:3339)
at processing.video.Movie.initGStreamer(Unknown Source)
at processing.video.Movie.(Unknown Source)
at video.setup(video.java:27)
at processing.core.PApplet.handleDraw(PApplet.java:2051)
at processing.awt.PSurfaceAWT$9.callDraw(PSurfaceAWT.java:1386)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:356)

I moved my Processing libraries and everything else to C:\Processing instead of Documents\User\ etc etc etc and fixed the question. Thanks.

1 Like