# Rendering a long animation to file, not real time

**URL:** <https://discourse.processing.org/t/rendering-a-long-animation-to-file-not-real-time/46779>\
**Category:** Beginners\
**Created:** [July 23, 2025, 2:18am UTC](https://discourse.processing.org/t/rendering-a-long-animation-to-file-not-real-time/46779 "2025-07-23T02:18:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 23, 2025, 7:33pm UTC](https://discourse.processing.org/t/rendering-a-long-animation-to-file-not-real-time/46779/4 "2025-07-23T19:33:11Z")

</div>

Hello @MichaelMean ,

> [@MichaelMean](#):
>
> As far as rendering without going through the draw() loop I guess I can do all of the image processing work and either comment out the draw or put some logic in there to skip the on screen drawing.

Ignore below if you want to tackle this yourself.  
Your post inspired me and I cooked this up this morning!

Related:  
_[Movie Maker: Time gap between movie and its audio file - #2 by glv](https://discourse.processing.org/t/movie-maker-time-gap-between-movie-and-its-audio-file/46748/2)_

This is a version of above that does rendering outside of _draw()_:

```auto
/**
 * MovieMaker Frame Generator for Testing
 * 
 * Author: glv
 * Date: 2025-07-23
 * Version: 1 0 0
 *
 * Generates frames for testing without draw():
 */

int marker_10s;

void setup()
  {
  //size(1920, 1080);
  size(600, 600); 
    
  int t0 = millis();
  
  int videoTimeSecs = 60; // Must be in seconds 
  int desiredFrameRate = 60; // For MovieMaker!
  int framesToSave = videoTimeSecs*desiredFrameRate;
  
  // frameRate(1000); // Make this 1000 and let the rendering fly!  
  
  marker_10s = 10*desiredFrameRate;
  println("marker_10s:", marker_10s);
  println();
  println("It's show time!");
  println();
  println("videoTimeSecs:", videoTimeSecs);
  println("desiredFrameRate", desiredFrameRate);
  println("framesToSave", framesToSave );
  delay(1000);
  println();
  
  // Common to all text:
  textAlign(CENTER, CENTER);
  textSize(96);
  fill(0);
 
// If using drawFrame()
  for (int i = 0; i < framesToSave ; i++) 
    {
    drawFrame(i);
    //println(i); // Fills console!

    if (i%100 == 0) // Every 100!
      println(i);    
    
    saveFrame("frames/frame-" + nf(i, 5) + ".tga"); //tga is fast! png is slow...
    //saveFrame("frames/frame-" + nf(i, 5) + ".png"); //tga is fast! png is slow...
    }
  
   background(255, 255, 0); 
   text("Done!", width/2, height/2); // Adjusted so starts at 0
  
  int t1 = millis();
  int dt = t1-t0;
  println("Total time:", nfs(dt/1000.0, 0, 2) + "s");
  println("Average frame:", nfs( (float) dt/framesToSave, 0, 2) + "ms");  
    
  //exit(); // Automatically close Processing window
  noLoop();
  }
  
void drawFrame(int frame)  
  {
  if(frame > marker_10s)
    {
    background(255, 0, 0);
    }  
  else
    background(255, 255, 0);
    
  text(frame, width/2, height/2); // Adjusted so starts at 0
  }

```

It may need finessing.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/rendering-a-long-animation-to-file-not-real-time/46779)._
