Exporting Videos from Processing

This best practice makes it easy to export videos from Processing. Before you start, make sure you have the VideoExport-library and FFMPEG installed properly on your computer. If you don’t know what i am talking about and/or you need help, check out this blogpost.

YouTube

By loading the video, you agree to YouTube’s privacy policy.
Learn more

Load video

Basically, all you have to do is copy-paste the code in your sketch and add the rec() function to the very end of your draw loop. Once you start the sketch, a video is saved in mp4 format.

final String sketchname = getClass().getName();

import com.hamoid.*;
VideoExport videoExport;

void rec() {
  if (frameCount == 1) {
    videoExport = new VideoExport(this, "../"+sketchname+".mp4");
    videoExport.setFrameRate(30);  
    videoExport.startMovie();
  }

  videoExport.saveFrame();
}

Published by Tim on Monday August 17, 2020

Last modified on September 4th, 2020 at 18:05


Related

4. September 2020

Bauhaus 101 – A beginners Processing Tutorial

Hi and welcome to this very condensed and quick tutorial that aims to get you amazed for Creative Coding in […]

20. August 2020

How to use p5.js with Visual Studio Code

In this short tutorial i explain how you can use p5.js with Visual Studio Code. For this purpose, i’ll use […]

17. August 2020

New Course: Bauhaus Coding Workshop

After many weeks of hard work, I am very happy to be able to publish my new course “Bauhaus Coding […]

27. July 2020

The Magic Triangle

The Magic Triangle is a powerful creativity technique that can be applied to many different areas.

20. March 2020

Processing-Tutorial: Rasterize 3D

In this tutorial I show you how to create abstract 3D portraits from any image file. Here you will learn […]

15. March 2020

Alpha-Release: “Creative Coding Essentials”

After more than 7 months of experimentation, planning and creating i am finally abled to release a first Alpha-version of […]

6. December 2019

Processing-Tutorial: Image-Rasterizer

Level: Beginner & intermediate In this tutorial i’ll guide you through all the necessary steps to rasterize an image with […]

4. November 2019

Processing-Tutorial: WAVES pt. 1

This is the first part of a brand new tutorial-series about Waves, a fundamental skill and feature in Generative Design […]

19. July 2019

Getting started with Creative Coding

I quite get often asked for advices on how to get started with creative coding. These are my most essential […]

16. April 2019

Processing-Tutorial: Kinetic Typography 1

In the last years i’ve observed a new tendency in typography and graphic design which has been made possible by […]

14. April 2019

Processing-Tutorial: Video Export

One of the most powerful features of Processing in comparison to all web-based approaches and frameworks (like p5.js) is the […]

1. March 2019

How to rasterize an image with Processing

In this post i’ll teach you how to access the data of an image and how to use it to […]

28. February 2019

My 10 favorite Processing-libraries

So called “libraries” extend the functionality of the software-development-enviroment Processing. Please handle those extensions with care: If you are a […]

18. December 2018

Processing or p5.js? My opinions

In this video i share my opinions about the benefits of p5.js and Processing. I also talk about how i’ve […]