Skip to content

Black screen using postFX #36

@lucaoskaique

Description

@lucaoskaique

Hi guys, i'm trying to use postFx but it's not working with my video, what am i missing?

Perhaps my computer is not powerful enough?

I'm new with processing.

import processing.video.*;
import processing.sound.*;
import ch.bildspur.postfx.builder.*;
import ch.bildspur.postfx.pass.*;
import ch.bildspur.postfx.*;

PostFX fx;

SoundFile file;
Movie myMovie;
Amplitude amp;

int numPixels;
int blockSize = 1;
color myMovieColors[];

void setup(){
 fullScreen(P3D);
  
  fx = new PostFX(this); 
  //file = new SoundFile(this, "FKAtwigs.mp3");
  //file.play();
  
  //amp = new Amplitude(this);
  //amp.input(file);
  
  myMovie = new Movie(this, "teo2.mp4");
  numPixels = width/blockSize;
  myMovieColors = new color[numPixels * numPixels];
  myMovie.loop();
}

void movieEvent(Movie m) {
  m.read();
  m.loadPixels();
  m.play();

  for(int j = 0; j < numPixels; j = j + 8){
    for(int i = 0; i < numPixels; i = i + 8){
      myMovieColors[j * numPixels + i] = m.get(i, j);
    }
  }
}
void draw(){
  background(0);
  //float vol = amp.analyze()*600;  
  
  for(int j = 0; j < numPixels; j = j + 8){
    for(int i = 0; i < numPixels; i = i + 8){
      int loc = myMovieColors[j * numPixels + i];
      float r = red(loc);
      float g = green(loc);
      float b = blue(loc);
      float br = brightness(loc);
      strokeWeight(5);  
      stroke(r, g, b);   
      point(i * blockSize, j * blockSize, (br * 1.2));
    }
  }
  //saveFrame("frames/##########.jpg");
  //image(myMovie, 100, 100);
  fx.render().bloom(0.5, 20, 40).compose();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions