Trouble exporting video with VideoExport library - no errors but no .mp4 written to file

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

Hi @DarkLight,

Always good to look inside the given examples coming with a library.

ie:

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