processing / processing-video

GStreamer-based video library for Processing
274 stars 130 forks source link

"Seek operation failed" and blank pixel arrays with P2D/P3D on Windows 10 #167

Open AndrewChittenden opened 3 years ago

AndrewChittenden commented 3 years ago

Issue

When canvas is set to P2D or P3D, all Movie class functions (like read(), loop(), etc.) result in the error "Seek operation failed", and get() operations result in blank pixel arrays. Using default renderer, errors do not occur: video is read correctly, and pixels are correctly loaded.

This error has occurred on multiple Windows 10 PCs. However, this same sketch runs perfectly on macOS Catalina 10.15.7, using the same version of Processing and the same Video library version.

Potentially related to Issue #166 https://github.com/processing/processing-video/issues/166, but I do not receive any of those other errors.

Code to reproduce

import processing.video.*;

Layer layer;

void setup() { size(900,900); //Switch this to P3D to create an error layer = new Layer(this, "1105_L4_objects_RAB.mp4"); //Place your own mp4 in the data folder and replace filename }

void draw() { image(layer.frame,0,0); }

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

class Layer { PImage frame; //Stores the first frame of the video Movie m;
Layer(PApplet parent, String f) { m = new Movie(parent, f); m.loop(); m.read(); m.pause(); m.loadPixels(); int w = m.width; int h = m.height; frame = m.get(0, 0, w, h); } }

Environment

Processing 3.5.4 Windows 10 Video Library 2.0 (Release 3-8)