Gstreamer issue: No Real Random Source Present Processing 3.5 and 4 Video Not working

I have been having a long term issue with Processing 3.5-4.0 video library. I have not been able to use Processing video all year and it has impacted my artistic process.

I am using Processing video library using GStreamer 1.16.2
I fresh installed Processing 4 with Video 2.0 library.

When I try to run the basic “frames” example I get this error:
WARNING: no real random source present!

  1. I checked the file name and location and it is in the data folder
  2. I’ve researched and found many others having a similar issue
  3. I have had this issue across Processing 3.5.4- 4
  4. I have fixed Capture issues by changing the pipeline, but not for Movie()

So far I have been able to fix the Capture based examples with a fix from

@neilcsmith the change the pipline
example:
“video = new Capture(this, “pipeline:autovideosrc”);”

but I don’t know how to fix the pipeline issue with a regular Movie src
example " mov = new Movie(this, “launch2.mp4”);"

Code:

/**
 * Frames 
 * by Andres Colubri. 
 * 
 * Moves through the video one frame at the time by using the
 * arrow keys. It estimates the frame counts using the framerate
 * of the movie file, so it might not be exact in some cases.
 */
 
import processing.video.*;

Movie mov;
int newFrame = 0;

void setup() {
  size(560, 406);
  background(0);
  // Load and set the video to play. Setting the video 
  // in play mode is needed so at least one frame is read
  // and we can get duration, size and other information from
  // the video stream. 
  mov = new Movie(this, "launch2.mp4");
  
  // Pausing the video at the first frame. 
  mov.play();
  mov.jump(0);
  mov.pause();
}

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

void draw() {
  background(0);
  image(mov, 0, 0, width, height);
  fill(0);
  text(getFrame() + " / " + (getLength() - 1), 10, 30);
}

void keyPressed() {
  if (key == CODED) {
    if (keyCode == LEFT) {
      if (0 < newFrame) newFrame--; 
    } else if (keyCode == RIGHT) {
      if (newFrame < getLength() - 1) newFrame++;
    }
  } 
  setFrame(newFrame);  
}
  
int getFrame() {    
  return ceil(mov.time() * 30) - 1;
}

void setFrame(int n) {
  mov.play();
    
  // The duration of a single frame:
  float frameDuration = 1.0 / mov.frameRate;
    
  // We move to the middle of the frame by adding 0.5:
  float where = (n + 0.5) * frameDuration; 
    
  // Taking into account border effects:
  float diff = mov.duration() - where;
  if (diff < 0) {
    where += diff - 0.25 * frameDuration;
  }
    
  mov.jump(where);
  mov.pause();  
}  

int getLength() {
  return int(mov.duration() * mov.frameRate);
}```
1 Like

This isn’t an error, it’s just over-zealous logging from GStreamer (or probably underlying GLib).

Seeking is a bit broken in the video library, and can also be somewhat codec dependent. The video library for some reason doesn’t respond to the pre-roll listener, which allows for better seeking / seeking in pause state. I’m going to say what I say to everyone here, try it in PraxisLIVE instead. We have our own integration between Processing and GStreamer, using the same underlying GStreamer bindings which we also maintain. Video library is in need of some love from someone!

2 Likes