Hello.
I’m not sure what’s going on. I see that the VideoExport library is installed, I can navigate to it. The directory I am saving to does exist. I’m not getting any error, the drawing runs but no frames are saved. I basically want to turn it into a gif. Not sure if this is the best way.
This is the code from a post I saw on Twitter. It’s really cool but it also runs really slow on my PC.
import com.hamoid.*;
VideoExport videoExport;
void setup(){
size(800,800);
videoExport = new VideoExport(this, "C:/Users/.../Documents/Processing/.../TestVideo.mp4");
}
void draw(){
background(random(255), random(255), random(255)); // Randomly change background color
videoExport.saveFrame();
if(frameCount == 30 * 10) //Stop recording after 10 seconds
{
videoExport.endMovie();
exit();
}
}
mnse
July 1, 2023, 5:24am
2
Hi @DarkLight ,
Always good to look inside the given examples coming with a library.
ie:
import com.hamoid.*;
VideoExport videoExport;
// Press 'q' to finish saving the movie and exit.
// In some systems, if you close your sketch by pressing ESC,
// by closing the window, or by pressing STOP, the resulting
// movie might be corrupted. If that happens to you, use
// videoExport.endMovie() like you see in this example.
// In other systems pressing ESC produces correct movies
// and .endMovie() is not necessary.
void setup() {
size(600, 600);
videoExport = new VideoExport(this);
videoExport.startMovie();
}
This file has been truncated. show original
You’ll notice, that there is a call to …
videoExport.startMovie();
… right after creating the VideoExport instance, which seems to be missed in your code above…
Cheers
— mnse
PS: there is also a library called GifAnimation which you can check out…
2 Likes