Help please! - GStreamer-CRITICAL **:

edited December 2013 in Library Questions

Hello everyone,

im stuck with my project because GStreamer gives me a critical. Here´s the part of the code:

import codeanticode.gsvideo.*;
GSMovie movie;

void setup ()
{
  size(windowwidth,windowheight, P2D);
  frameRate(30);
  noStroke();

  //Music-Load
  minim = new Minim(this);
  player = minim.loadFile("title.mp3", 2048);
  hover1 = minim.loadSnippet("hover1.mp3");
  hover2 = minim.loadSnippet("hover2.mp3");
  hover3 = minim.loadSnippet("hover3.mp3");

  //video load
  movie = new GSMovie(this, "movie.mov");
  movie.loop();

  //Mouse Cursor
  mouseCursor = loadImage("mouse.png");
  mouseCursorLeft = loadImage("mouseLeft.png");
  mouseCursorRight = loadImage("mouseRight.png");

  //images szene0
  szeneStart = loadImage("szeneStart.png");
  img1 = loadImage("szene0.png");
  img2 = loadImage("szene0-1.png");
  img4 = loadImage("szene0-3.png");


  //load all mouse-over Signs
  s_schule = loadImage ("sign0.png");
  s_amyshouse = loadImage ("sign1.png");
  s_cam = loadImage ("sign2.png");

  //load all tool-images
  tool = loadImage("tool.png");
  toolh = loadImage("toolh.png");
  tool1 = loadImage("tool1.png");
  tool1h = loadImage("tool1h.png");
  tool2 = loadImage("tool2.png");
  tool2h = loadImage("tool2h.png");
  back = loadImage("back.png");
  backh = loadImage("backh.png");
  berfolg= loadImage("b-erfolg.png");
  berfolgh = loadImage("b-erfolgh.png");
  binventar = loadImage("b-inventar.png");
  binventarh = loadImage("b-inventarh.png");

  //load other szenes
  szeneErfolge = loadImage("szeneErfolge.jpg");

  //load animations
  camactive0 = loadImage ("camactive0.png");
  camactive1 = loadImage ("camactive0.png");
  fish = loadImage ("fish.png");
  fishB = loadImage ("fishB.png");

  //load all main szenes
  for(int i = 0; i < szenes.length; i++)
  {
    szenes[i] = loadImage( "szene" + i + ".jpg");
  }

    hover1 = minim.loadSnippet("hover1.mp3");

}  

void draw () 
{
 background(0);

 if (szeneIndex == -1)
 {
   szeneStart();
 }
 if (szeneIndex == 0)
 {
   szeneZero();
 }
 if (szeneIndex == 1)
 {
   szeneOne();
 }
 if (szeneIndex == 2)
 {
   szeneTwo();
 }
 if (szeneIndex == 3)
 {
   szeneThree();
 }
 if (szeneIndex == 4)
 {
   szeneFour();
 }

}

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


void szeneOne ()
{
  image(szenes[3],0,0);
  image(back, 1310, 690);
  if (mouseX > 1310 && mouseX < 1410 && mouseY > 690 && mouseY <  794 )
  {
      image(backh, 1310, 690);
  }


  if(mouseX > 583 && mouseX < 637 && mouseY > 491 && mouseY <  529 && mousePressed)
  {
   erfolg1=true;
  }

  noCursor();
  image(mouseCursor,mouseX,mouseY);

  //Movie für Erfolg1 
  image(movie, mouseX-movie.width/2, mouseY-movie.height/2);

}

Tried the normal movie lab first, same error with GStreamer. Checked java version. Same error on another machine, x64 and x86 tested.

The Video should be seen in the szeneOne, but it´s not starting. The video-file is okay, tested it in another project. When i click on "stop" everything does shut down as expected. When i hit ESC the following error turns up:

(java.exe:6112): GStreamer-CRITICAL **: Trying to dispose element GSMovie Player, but it is in READY instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

Any idea how to fix that? I read i should try to nullify the pipeline. How do i do that? I have no clue at all, im a newbie to processing :/

Thanks, Markus

Answers

  • Does no one have an idea? :( Im really stuck

  • Hi markus,

    Sounds like you may need to register a dispose handler and set your GSMovie to null when the app exits. See this philho's example on this thread for an example: http://forum.processing.org/one/topic/run-code-on-exit#25080000000790253.html

    alternately, if you are exiting the program, does it really matter that it is throwing an error? I think best practice would say to try to clean things up, but if you're done with the app... just saying :)

    hope this helps! ak

  • Answer ✓

    I only answered half your problem, sorry about that.

    A few questions about your usage, are you using processing 1.5? why not switch to 2.0 as it has all the GSVideo stuff built into it and works great in my experience.

    If you are set on 1.5, then check out this thread where I posted a MovieCapsule class example that I've had great luck with. It takes care of all the complicated GSVideo stuff and you just pass it a video filepath then tell it where to draw. http://forum.processing.org/one/topic/gsvideo-0-9-glgraphics-0-99#25080000001029346.html

    you may still run into your cleanup issue, but I don't remember encountering that myself.

    Hope this helps ( ...more :) ) ak

  • Hey Ak,

    thanks for your advice. I gonna check the other post and look if that solves my problem. I dont have any problem if theres an error while exiting the program, however the video does not run. I am using Processing 2.0, the GSMovie lab was a try because the original build-in lab did not work. But GSMovie does not work as well, so im gonna switch back to the build-in lab :)

    Thanks, Markus

  • Answer ✓

    Hey Markus,

    I've had similar problems, where the video doesn't play on the first try. This seems to usually solve the issue:

            if (movie.time() > 0) {
              image(movie, 0, 0);
            } 
            else {
              output.println("kickstart video");
              movie.loop();
            }
    

    It will keep trying to start the video if the time is less than 0 (hasn't started).

    Hope this helps! ak

  • Hello,

    all right, i got rid of the GStreamer critical, the dispose handler worked very well. Thanks for the advice!

    Unfortunately the video still does not start. However it does start on a OS X System... I can´t figure out why. I tried your solution, but at all it says is "kickstart video" like forever. On the OS X machine it runs pretty fine o.0

Sign In or Register to comment.