Advice using GSVideo - error, disabling movieEvent()

Hi,

I'm trying to play an array of 4 videos (1280/720) on screen at once. I was hoping GSVideo would help but I'm getting errors 'error, disabling movieEvent()' when I run my code. Could you please advise what I'm missing? Code below:

import processing.opengl.*;
import codeanticode.glgraphics.*;
import codeanticode.gsvideo.*;

GSMovie[] movies = new GSMovie[4];
GSMovie bgmovie;

void setup() {

  size(displayWidth, displayHeight);
  frameRate(30);
  movies[0] = new GSMovie(this, "IMG_0051.mov");
  movies[1] = new GSMovie(this, "IMG_0052.mov");
  movies[2] = new GSMovie(this, "IMG_0053.mov");
  movies[3] = new GSMovie(this, "IMG_0069.mov");

  movies[0].play();
  movies[1].play();
  movies[2].play();
  movies[3].play();

}

void movieEvent(GSMovie movies) 
{
  movies.read();
}

void draw()
{
  background(0);
  image(movies[0],0,0,width/2,height/2);
  image(movies[1],width/2,0,width/2,height/2);
  image(movies[2],0,height/2,width/2,height/2);
  image(movies[3],width/2,height/2,width/2,height/2);
}

Answers

    • Dunno about that GSVideo library. Seems like a video player for OpenGL renders? :-/
    • Perhaps you should specify 1 in size() like: size(..., ..., P2D);:
      https://processing.org/reference/size_.html
    • Or then, use Processing's bundled Video library instead? :-\"
  • Hi GoToLoop!

    Thanks for having a look. I don't think P2D was required. Gave it a go but no dice. Tried the examples in the repository and they seem to be giving the same error. Either I'm missing something or it is broken. On the off chance it is any use here is the error log:

    GSVideo version: 1.0.0 error, disabling movieEvent() for IMG_0053.mov error, disabling movieEvent() for IMG_0052.mov error, disabling movieEvent() for IMG_0051.mov java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at codeanticode.gsvideo.GSMovie.invokeEvent(Unknown Source) at codeanticode.gsvideo.GSMovie$2.rgbFrame(Unknown Source) at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(RGBDataAppSink.java:162) at org.gstreamer.elements.AppSink$2.callback(AppSink.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384) at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414) Caused by: java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) at java.awt.image.BufferedImage.<init>(Unknown Source) at processing.core.PImage.getNative(PImage.java:322) at processing.core.PImage.resize(PImage.java:616) at codeanticode.gsvideo.GSMovie.read(Unknown Source) at GSMovieTest.movieEvent(GSMovieTest.java:51) ... 14 more java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at codeanticode.gsvideo.GSMovie.invokeEvent(Unknown Source) at codeanticode.gsvideo.GSMovie$2.rgbFrame(Unknown Source) at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(RGBDataAppSink.java:162) at org.gstreamer.elements.AppSink$2.callback(AppSink.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384) at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414) Caused by: java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) at java.awt.image.BufferedImage.<init>(Unknown Source) at processing.core.PImage.getNative(PImage.java:322) at processing.core.PImage.resize(PImage.java:616) at codeanticode.gsvideo.GSMovie.read(Unknown Source) at GSMovieTest.movieEvent(GSMovieTest.java:51) ... 14 more java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at codeanticode.gsvideo.GSMovie.invokeEvent(Unknown Source) at codeanticode.gsvideo.GSMovie$2.rgbFrame(Unknown Source) at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(RGBDataAppSink.java:162) at org.gstreamer.elements.AppSink$2.callback(AppSink.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384) at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414) Caused by: java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) at java.awt.image.BufferedImage.<init>(Unknown Source) at processing.core.PImage.getNative(PImage.java:322) at processing.core.PImage.resize(PImage.java:616) at codeanticode.gsvideo.GSMovie.read(Unknown Source) at GSMovieTest.movieEvent(GSMovieTest.java:51) ... 14 more error, disabling movieEvent() for IMG_0069.mov java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at codeanticode.gsvideo.GSMovie.invokeEvent(Unknown Source) at codeanticode.gsvideo.GSMovie$2.rgbFrame(Unknown Source) at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(RGBDataAppSink.java:162) at org.gstreamer.elements.AppSink$2.callback(AppSink.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384) at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414) Caused by: java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) at java.awt.image.BufferedImage.<init>(Unknown Source) at processing.core.PImage.getNative(PImage.java:322) at processing.core.PImage.resize(PImage.java:616) at codeanticode.gsvideo.GSMovie.read(Unknown Source) at GSMovieTest.movieEvent(GSMovieTest.java:51) ... 14 more

Sign In or Register to comment.