Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen using postFX #36

Open
lucaoskaique opened this issue Jan 23, 2022 · 3 comments
Open

Black screen using postFX #36

lucaoskaique opened this issue Jan 23, 2022 · 3 comments
Labels

Comments

@lucaoskaique
Copy link

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();
}
@cansik
Copy link
Owner

cansik commented Jan 24, 2022

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

@lucaoskaique
Copy link
Author

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?

@cansik
Copy link
Owner

cansik commented Jan 26, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants