I'm assuming it's possible to display video in PGraphics object?
I can get code working with an image, but video doesn't display. The video loads as I can hear sound, but no video frame image. Am I doing something wrong?
Yep great your example works fine. I can see there are a few differences to mine notably the JAVA2D setting, the delay(50); and redraw();
Will using JAVA2D effect what platforms the sketch can run on?
Thanks for the format code link too!
So it turns out I just had to supply the renderer type in the createGraphic method.
Now I can use P2D or P3D if I choose. Which I do, as I'm hoping to use createGraphics as a buffer and do multiple passes, before outputting and thought this should speed things up?
Answers
import processing.video.*;
http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text
This adapted example works for me: :-\"
Yep great your example works fine. I can see there are a few differences to mine notably the JAVA2D setting, the delay(50); and redraw(); Will using JAVA2D effect what platforms the sketch can run on? Thanks for the format code link too!
JAVA2D is the default renderer. Using size() w/o specifying a 3rd parameter implies JAVA2D!
"Thanks for the format code link too!"
I suggest to read it attentively and to train on the previous message, which you can edit... :-D
So it turns out I just had to supply the renderer type in the createGraphic method. Now I can use P2D or P3D if I choose. Which I do, as I'm hoping to use createGraphics as a buffer and do multiple passes, before outputting and thought this should speed things up?
import processing.video.*; PGraphics pg; PImage img; Movie movie; void setup() { size(640, 480, P3D); pg = createGraphics(width, height, P3D); ///img = loadImage("iStock_000015044044Small.jpg"); movie = new Movie(this, "MVI_2686.MOV"); movie.loop(); } void movieEvent(Movie m) { m.read(); } void draw() { pg.beginDraw(); //pg.image(img, 0, 0, width, height); pg.image(movie, 0, 0, width, height); pg.endDraw(); image(pg, 0, 0); }