Jump() in videolibrary causes java error ...

PerPer
edited December 2016 in Raspberry PI

Hi!

The jump() doesnt work for me in the video library when im using processing on Raspberry PI.

Any tips how to solve this or using another library for video? Or another way creating looppoints in video?

I get this errormessage:

#

A fatal error has been detected by the Java Runtime Environment:

#

SIGSEGV (0xb) at pc=0x76ecdf4c, pid=1498, tid=1755313248

#

JRE version: Java(TM) SE Runtime Environment (8.0_51-b07) (build 1.8.0_51-b07)

Java VM: Java HotSpot(TM) Client VM (25.51-b07 mixed mode linux-arm )

Problematic frame:

C [libarmmem.so+0x2f4c]

#

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

An error report file with more information is saved as:

/tmp/hs_err_pid1498.log

got a frame 640 368 true #

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

# Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help → Troubleshooting.

Heres the sketch:

import processing.video.*;

Movie movie;

void setup() {
  size(640, 360);
  background(0);
  // Load and play the video in a loop
  movie = new Movie(this, "transit.mov");
  movie.loop();
}

void movieEvent(Movie m) {
  m.read();
}

void draw() {
  //if (movie.available() == true) {
  //  movie.read();
  //}
  image(movie, 0, 0, width, height);
}

void keyPressed() {
  if (key == 'j') {
    movie.jump(1.0);
  }
}
Tagged:

Answers

  • Hi Per,

    Which version of the video library are you using? The one from the Contribution Manager? (See also: https://github.com/processing/processing/wiki/Raspberry-Pi#video-library)

    Video playback on the Raspberry Pi is still an area we're working on.

    Best gohai

  • Hi,

    I'm experimenting that problem too. Last GLvideo version seems to work better, but my sketch hangs from time to time. Any advice?

    Best.

  • @RaulF I haven't seen random hangs myself. Would check the power supply first.

  • @RaulF Do skecthes hang even when you're not using the video library?

  • Do skecthes hang even when you're not using the video library?

    Mmm... of course, no.

    Current configuration and test code This code hangs. Sometimes in 1 minute, sometimes it takes 2 hours. But it always hangs. This moring I have tried this code in 6 different machines. All of them hanged finally.

    I have made tons of tests (I won't enter into details), but it seems it works better with my 32 GB SD cards (fasters), than with my 16 GB SD cards (slowers).

    I notice that if I jump with the movie in pause, the program "plays" few milliseconds of the movie. It's not a "perfect" jump between 2 frames. This can be the problem. Maybe the program is trying to access to frames that are not ready yet. In fact, it works better with a fixed jump position, than a random jump.

    Rasp Pi2. All updated (OS, Processing, GLvideo, etc.)
    gpu_mem=612 (in config.txt)

    myVideoFile.mp4 = 7':31'', 566.8 MB, H264, AAC (yes, the video size can be the problem)

    import gohai.glvideo.*;
    GLMovie myMovie;
    
    int theJump;
    boolean isPlaying, isJumped;
    
    void setup() {
      size(400, 400, P2D);
      background(0);
    
      myMovie = new GLMovie(this, "myVideoFile.mp4");
      isJumped = false;
    }
    
    void draw() {
    
      // Play -> Pause -> Jump -> Play... (more stable if I stop before jumping)
      if (frameCount % 60 ==0) {
        isPlaying = myMovie.playing();
        if (isPlaying) {
          myMovie.pause();
          isJumped = false;
          println("pause");
        } else {
          if (isJumped) {
            myMovie.loop();
            isJumped = false;
            println("play");
          } else { 
            theJump = int(random(30, 400));
            myMovie.jump(theJump);
            isJumped = true;
            println("jump");
          }
        }
      }
    
      if (myMovie.available()) {
        myMovie.read();
      }
      image(myMovie, 0, 0, width, height);
    }
    
  • Then I see no point in checking the power supply. How are they even related?

  • In my last test I even turned off the wifi. No ethernet connection either. So, 6 Rasp, without network, hang playing this code.

    I have try different power supply. Always hang.

    Thanks! r.-

  • Of course the power supply isn't the problem, or anything else for that matter.
    Either the problem is with the video library, or with your graphics card (or its driver), or with your video files.
    However, since you said that you tested on 6 systems, I can't see how it could be any other than the first.

  • with your graphics card (or its driver)

    I'm using the official touchscreen, with the OS drivers.

    your video files

    I haven't explored in deep, but they are in a very "standard" format (MP4, H264, and AAC). I tried with MOV too. Same result.

    the video library

    That's what I think. It surprises me that, even with the movie in pause, when I jump, the program plays few millisecons of the movie. It's not a "perfect" jump. Well, maybe it has no relation with the hangs.

    Thanks for your time Lord!
    r

  • However, since you said that you tested on 6 systems, I can't see how it could be any other than the first.

    I said the same thing as well, but you've given a proper explanation beforehand just in case someone doubts that the problem is with your computer.

  • I have been trying this morning with different values of gpu_mem, but it hangs, hangs, hangs,... No one else have problems with the jump()? I don't know what to try more.

    Thanks!

  • I have found a very surprising pattern. The movie(s) doesn't like to jump FROM some places. It's not a random behaviour. With my movie, the jump doesn't work when I try to jump from the second 21 or 22.

    Test Sketch 1 (based in previously code)

    myMovie = new GLMovie(this, "myVideoFile.mp4");
    ...
    
    // Play -> Pause -> Jump -> Play...  in intervals of 4 seconds
    
    theJump = int(random(0, 60));
    
    // If theJump = 17 or 18, the sktech hangs. Always.
    // It doesn't care WHERE it will jump. It hangs when the sketch
    // tries to jump FROM 21 or 22 (theJump + 4 seconds).
    // With any other values, it doesn't hang. Never.
    

    Test Sketch 2 (based in previously code)

    myMovie = new GLMovie(this, "myVideoFile.mp4");
    ...
    
    // Play -> Pause -> Jump -> Play...  in intervals of 1 seconds
    
    theJump = int(random(0, 60));
    
    // If theJump = 20 or 21, the sktech hangs. Always.
    // It doesn't care WHERE it will jump. It hangs when the sketch
    // tries to jump FROM 21 or 22 (theJump + 1 second).
    // With any other values, it doesn't hang. Never.
    

    I have tried in 3 Rasp Pi 2B. I use the same movie in both sketches. The movie is fine (I have tried with several movies. It seems that different movie length, different problematic jump seconds - I have to check it). I have tried with different gpu_mem values too, and the results are always the same.

    Well, maybe this helps to figure out what's happening.

    Best.

Sign In or Register to comment.