processing-postfx icon indicating copy to clipboard operation
processing-postfx copied to clipboard

Black screen using postFX

Open lucaoskaique opened this issue 2 years ago • 3 comments

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();
}

lucaoskaique avatar Jan 23 '22 18:01 lucaoskaique

Hi, could you please explain a little more precisely what is not working? What have you tried, what works (example sketches?), what exactly do you want to achieve? And I also need some information about your operating system, processing version etc.

And are you sure it's the library? And if so, please create a very simple example that shows the error. Preferably with an example frame from the video, which I can also run on my system.

For example just printing some white points works and blurring them seems to work:

import ch.bildspur.postfx.builder.*;
import ch.bildspur.postfx.pass.*;
import ch.bildspur.postfx.*;

PostFX fx;

void setup() {
  size(500, 500, P3D);

  fx = new PostFX(this);
}

void draw() {
  background(55);

  // draw a rectangle
  stroke(255);
  strokeWeight(2);
  for (int y = 0; y < 100; y++) {
    for (int x = 0; x < 100; x++) {
      point((x * 4), (y * 3) + 50);
    }
  }

  fx.render()
    .bloom(0.5, 20, 30)
    .compose();
}

cansik avatar Jan 24 '22 09:01 cansik

Hey, @cansik , how are u, i'm sorry for the bad issue posting.

I've tried all the examples, they worked fine.

In my code i'm trying to edit a video, to make the video pixels to be 3D, this part worked, but when i use postFX thing doesn't work out.

My setup is: i5 3570, 16gb, rx570 with windows 10 build 1943 verson 21H1.

I used Processing 4, didn't had time to test with processing 3, do you think it will work better? Is build number three better for postFX?

Or am i doing something wrong forgetting something?

lucaoskaique avatar Jan 26 '22 19:01 lucaoskaique

Ok, if all the examples run and work it maybe has to do with the points you are drawing. Does my point-drawing example sketch work?

And would it be possible to share the sketch together with the video so I can test it on my system? You can upload a zip file here (drag into the text field), if the video content is not confidential and not too big.

cansik avatar Jan 26 '22 21:01 cansik