Ojey
February 15, 2025, 7:31pm
1
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
Chrisir
February 15, 2025, 7:55pm
2
can you show your code please?
It looks like something related to String or to substring?
1 Like
glv
February 15, 2025, 9:11pm
3
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.
:)
Ojey
February 15, 2025, 9:13pm
4
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);
}
}
Ojey
February 15, 2025, 9:14pm
5
I’m using Processing 4, i’m on window 11
glv
February 15, 2025, 9:17pm
6
The library is intended for Raspberry Pi & Linux:
:)
1 Like
Ojey
February 15, 2025, 9:19pm
7
Ok !
Because i have to make a player video with many videos (.mov with alpha channel) and internet told me that GLvideo was the best one…
Ojey
February 15, 2025, 9:20pm
8
Tks a lot, if you have a solution ?
Or use simple this
import processing.video.*;
glv
February 15, 2025, 9:23pm
9
Use that. I provided an example that works with W10… should be fine for W11.
Let us know!
1 Like
Ojey
February 15, 2025, 9:26pm
10
Just tks a lot for your answer you really help me to open my eyes (and read everything…Raspberry Pi & Linux ) i spend one day on it
1 Like
glv
February 15, 2025, 9:31pm
11
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…
Have fun!
:)