openFrameworks is a C++ opensource library used by artist

to create amazing looking visualisations and installations. See our projects settings for things which have been made using openFrameworks. On this unofficial site you can find projects, programming techniques, tutorials, community news, workshops and addons. Download the library now!.

This article describes how you can create a HD video from your openFrameworks application which you can put online on Vimeo or Youtube for example. When I started I tried to use After Effects to create a HD video though the quality and size were not as I expected. Also, creating a video from the visualisation I did was not just a couple of clicks as I hoped. For the flocking tutorial I needed to create a good looking video which is on vimeo.

This article describes how you can create a HD video from your openFrameworks application which you can put online on Vimeo or Youtube or any other of your favorite video site. When I started I tried to use After Effects to create a HD video though the quality and size were not as I expected. Also, creating a video from the visualisation I did was not just a couple of clicks as I hoped for. For the flocking tutorial I needed to create a good looking video which is on vimeo.

These are the steps you need to do:

  1. Create png images from each frame
  2. Create a HD movie from these stills / image sequence.

1. Create png images from each frame

In your application you should add this code which writes each frame to an image file sequence.

// img_saver is of type ofImage
static char file_name[255];
sprintf(file_name, "output/output_%0.4i.png", saved_image_num);
img_saver.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
printf("Saving file: %s\n", file_name);
img_saver.saveImage(file_name);
saved_image_num++;

This saves each frame to a file named output_001.png, output_002.png etc.. Make sure you create the output directory in your bin/data/ folder.. saved_image_num is of type int and a member of the testApp class. I also tried to use memo's threaded image saver, but this one skipped some frames. I got files like 001, 003, 004, 006 etc..

Also make sure your application has a window which is conform HD:

int main( ){
    ofAppGlutWindow window;
    ofSetupOpenGL(&window, 1280,720, OF_WINDOW);        
    ofRunApp( new testApp());
}

2. Create a HD movie from these stills / image sequence.

Now, download Avidemux and make sure you've got the Xvid codec installed. Once you've installed Avidemux, run it. Now follow these steps:

  • File > Open and select the first file of the image sequence
  • At the video selectbox, select MPEG-4 ASP (XVid4)
    vimeo_hd_video_codec.png
  • Click on "Configure" under Video and use these settings: vimeo_hd_video_settings.png

  • Click on the "Filters" button > Interlacing > Add the "yadiff" (click green plus sign to add it)
    vimeo_hd_video_yadiff.png

  • Than you only need to save the video and it starts rendering. That's all! So File > Save> Save Video...

  • As format I used "avi"

Community news

  • carles 00:37, Great unofficial site! Hope can share here some projects also. Thanks OF ^^

  • Simon 01:17, Sorry ! I just have to use the gui.. wonderful source ! thanks a lot

  • Simon 01:01, Hi ! I have tried to compile the boid example .. but when the app starts, nothing appends because it's try to load _settings.xml. Do you have an example of the settings xml file ? Thanks a lot !

  • escher 05:36, dear vanderlin, I couldn't find ofxBox2d from google code,where could I to get it? thanks!!

  • nomo 14:21, TO WILL: this line should look like this: gui.addSlider("boid.max_vel", slider_vals["boid.max_vel"],0.1f, 40.0f, 0.1f);

  • igoumeninja 19:50, ok, i done it.

  • igoumeninja 19:27, how can i declare saved_image_num and img_saver at the make video tutorial?

  • Will 04:53, Could you please help me to fix this problem? http://www.openframeworks.cc/forum/viewtopic.php?f=14&t=2218 It may have something to do with my entry level skills but... I have tried to compile the example and the compiler threw an error in the TestApp.cpp file. "error: no matching function for call to 'ofxSimpleGuiToo::addSlider(const char [13], float*, float, float, float)''

  • download ofxBox2d 18:31, hey guys i am having probs downloading the OF wrapper for box2D from the google code page, is there another way to download it?

  • roxlu 17:08, posted youcube!