Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Processing 2.0 video alpha channel

$
0
0
hi rob,


I have done this before with an Animation compressed .mov file. the filesize gets pretty beastly but it does support the alpha channel. I posted this class on this other forum thread, it should do what you need:


  1. import processing.opengl.*;
  2. import codeanticode.gsvideo.*;
  3. import codeanticode.glgraphics.*;

  4. public class BGvideo {

  5.   GSMovie myMovie;
  6.   GLTexture tex;

  7.   public BGvideo (String videoFile, PApplet app) {

  8.     app.registerDraw(this); 

  9.     myMovie = new GSMovie(app, videoFile );
  10.     tex = new GLTexture(app);
  11.     myMovie.setPixelDest(tex);
  12.     myMovie.loop();
  13.   }
  14.   public void draw () {
  15.     myMovie.read();
  16.     if (tex.putPixelsIntoTexture()) {
  17.       background(255, 0, 0);
  18.       image(tex, 0, 0, 1920, 487);
  19.     }
  20.   }
  21. }


Viewing all articles
Browse latest Browse all 1768

Trending Articles