Probleme GL Video library

Hi i want to use the librairie GLvideo, i downloaded it, and when i want to try a example
Processing\libraries\glvideo\examples\SingleVideo (this one)
It should just play a vidéo with a simple code but i have this error : StringIndexOutOfBoundsException: begin 0, end -1, length 74

I need Gstreamer so i downloaded it and i still have the problem.
I’m stuck…Please could you help me ?

1 Like

can you show your code please?

It looks like something related to String or to substring?

1 Like

Hello @Ojey ,

I installed the GL Video library from the Contribution Manager:

It is intended to run using the Raspberry Pi or Linux.

If I run the example that comes with the library under W10 I get a similar error.

What version of Processing are you using?
Which Operating System?

With W10 I do not have to install GStreamer as it comes with the Video library.

I modified code to see if it worked under W10 without the GLVideo library: to see if there was an issue:

import processing.video.*;

/**
 *  Press the mouse button to change playback direction
 *  On Raspberry Pi: increase your GPU memory, to avoid
 *  OpenGL error 1285 at top endDraw(): out of memory
 */

//import gohai.glvideo.*;

Movie video;
boolean forward = true;

void setup() {
  size(560, 406, P2D);
  video = new Movie(this, "launch1.mp4");
  video.loop();
}

void draw() {
  background(0);
  if (video.available()) {
    video.read();
  }
  image(video, 0, 0, width, height);
}

void mousePressed() {
  forward = !forward;
  if (forward == true) {
    video.speed(1.0);
  } else {
    video.speed(-1.0);
  }
}

Above runs under W10 successfully with the bundled GStreamer gut will give errors with my installed GStreamer.

I can’t assist with the Raspberry PI or Linux versions of Processing.

:)

Yes, but this code come from the librairy, there are exemples in a foder,
By the way i have the same problem with all exemples in this library.

/**
 *  Press the mouse button to change playback direction
 *  On Raspberry Pi: increase your GPU memory, to avoid
 *  OpenGL error 1285 at top endDraw(): out of memory
 */

import gohai.glvideo.*;
GLMovie video;
boolean forward = true;

void setup() {
  size(560, 406, P2D);
  video = new GLMovie(this, "launch1.mp4");
  video.loop();
}

void draw() {
  background(0);
  if (video.available()) {
    video.read();
  }
  image(video, 0, 0, width, height);
}

void mousePressed() {
  forward = !forward;
  if (forward == true) {
    video.speed(1.0);
  } else {
    video.speed(-1.0);
  }
}

I’m using Processing 4, i’m on window 11

The library is intended for Raspberry Pi & Linux:

:)

1 Like

Ok !
Because i have to make a player video with many videos (.mov with alpha channel) and internet told me :rofl:that GLvideo was the best one…

Tks a lot, if you have a solution ?
Or use simple this
import processing.video.*;

Use that. I provided an example that works with W10… should be fine for W11.
Let us know!

1 Like

Just tks a lot for your answer you really help me to open my eyes (and read everything…Raspberry Pi & Linux :joy: ) i spend one day on it

1 Like

You are welcome!
The details are important.
This is part of the learning experience and you will get better at it!
Time well spent! Perhaps… :slight_smile:

Have fun!

:)