Sub topic 10
Rendering an Animation as an Image Sequence
This chapter assumes you can navigate the Properties editor and the Timeline, that you know how to set keyframes, and that you have already rendered a still image. It also assumes the scene has an active camera, a light, and at least one object. Here you will render an animation as a numbered series of image files, which is the safest way to produce an animation in Blender.
Why render an image sequence first
An animation render produces one image per frame. You can save those frames in two ways:
- As individual image files, such as PNG or OpenEXR. This is an image sequence.
- As frames encoded into a single video file. The FFmpeg chapter covers that.
An image sequence is the more robust choice for three reasons:
- Crash recovery. If Blender or the machine stops at frame 300 of 500, frames 1 to 299 are already on disk. A video file that was interrupted is often unusable.
- Re-rendering. You can fix a few bad frames and replace only those files.
- Quality. PNG and OpenEXR are lossless, so you can encode a video later without re-rendering anything.
The cost is disk space and an extra step to produce a playable video.
Set the frame range and frame rate
Open the Output properties tab and find the Frame Range panel. Three values control which frames are rendered:
| Setting | Meaning | Default |
|---|---|---|
| Frame Start | First frame to render | 1 |
| End | Last frame to render, inclusive | 250 |
| Step | Render every Nth frame | 1 |
The end frame is inclusive. Start 1 and End 48 render 48 images.
The Frame Rate setting in the Format panel does not change how many frames are rendered. It sets how fast the frames play back. At 24 fps, 48 frames last 2 seconds. At 12 fps, the same 48 frames last 4 seconds. Choose the frame rate before you render, because it also affects how any later video is timed.
A Step above 1 is useful for fast previews. Step 4 renders every fourth frame, so the render takes about a quarter of the time. The output file numbers still match the frame numbers, so you get frames 1, 5, 9, and so on.
Note that Frame Start and End in the Output properties are the scene's range. The Timeline has its own Use Preview Range option, which is a separate temporary range. If you turn on the clock icon in the Timeline header, the preview range limits playback only. Rendering uses the scene range unless you change it.
Set the output path and number padding
In the Output panel, the path field controls where files go and how they are named. Blender adds the frame number to the end of the file name automatically.
//renders/frame_is a path relative to the.blendfile (the//prefix means that). Frame 7 becomesframe_0007.png.- Without
#characters, Blender pads the number to four digits. - Each
#is one digit of padding.frame_#####givesframe_00007.png.
Use consistent padding. File names such as frame_7.png and frame_10.png sort in the wrong order in many tools, because frame_10 comes before frame_7 alphabetically. Padding avoids this.
The padding length is a minimum. A frame number larger than the padding is not truncated, so frame 12000 with four # characters becomes frame_12000.png. Choose enough digits for your highest frame number.
Turn on File Extensions in the Output panel (it is on by default) so Blender appends .png or the right extension for the format.
Control overwriting and placeholders
Two checkboxes in the Output panel decide what happens to files that already exist:
- Overwrite is on by default. Blender replaces any existing file with the same name.
- Placeholders creates an empty file for each frame before rendering it. A second Blender instance, or a render farm node, sees that file and skips the frame.
You can combine them to resume an interrupted render. Turn Overwrite off, and Blender skips frames whose files already exist. Run the same render again and it continues where it stopped.
With Overwrite off, a partly written file from a crash can look like a finished frame and be skipped. If a frame looks broken after a resume, delete that file and render again.
Choose a format suited to sequences
Set the file format in the Output panel. For image sequences, these are the usual choices:
| Format | Compression | Good for |
|---|---|---|
| PNG | Lossless | General use, 8-bit or 16-bit, small files |
| OpenEXR | Lossless or lossy options | Compositing, high dynamic range, 16 or 32-bit float |
| JPEG | Lossy | Quick previews, small files |
Use PNG when you plan to make a video. Use OpenEXR when you plan to do color correction or compositing afterward. JPEG discards data, and each re-save adds more loss, so avoid it for final frames.
If you pick a video format such as FFmpeg Video, Blender writes one file instead of a sequence. This chapter needs an image format.
Render the animation in the interface
Once the range, path, and format are set, choose Render > Render Animation or press Ctrl+F12. Blender opens the render window and shows each frame as it finishes. Press Esc in the render window to stop. Frames already written stay on disk.
Before you start a long render, check these items:
- The scene has an active camera. A missing camera gives an error and no output.
- The Frame Range matches what you intend, and Step is 1.
- The path points to a folder where you have write permission.
- Samples and resolution are set for the quality you want. Render a single frame from the middle of the animation first, and use its time to estimate the total.
To estimate total time, multiply the time of a representative frame by the number of frames. A frame that takes 90 seconds, across 240 frames, needs 6 hours.
Render the animation from Python
The same settings are available through bpy. The example below renders frames 1 to 48 as a PNG sequence.
import bpy
scene = bpy.context.scene
scene.frame_start = 1
scene.frame_end = 48
scene.frame_step = 1
scene.render.fps = 24
scene.render.image_settings.file_format = 'PNG'
scene.render.filepath = '//renders/frame_'
scene.render.use_overwrite = True
bpy.ops.render.render(animation=True)The call bpy.ops.render.render(animation=True) renders every frame in the range and writes each one. It differs from write_still=True, which saves only the current frame.
Render the animation from the command line
For long renders, run Blender in the background with no interface. The -b option selects background mode. The option order matters: Blender processes arguments from left to right, so set the output (-o) and format (-F) before the render action.
blender -b scene.blend -o //renders/frame_#### -F PNG -x 1 -s 1 -e 48 -a| Option | Meaning |
|---|---|
| `-b` | Run in the background, without the interface |
| `-o` | Output path, with `#` for frame number padding |
| `-F PNG` | Output file format |
| `-x 1` | Add the file extension to each file |
| `-s 1` | Start frame |
| `-e 48` | End frame |
| `-a` | Render the animation |
Put -a last. Options placed after it are not applied to that render. The -f option renders a single frame, and -a renders the full range, so do not use them together.
Common problems
- Only one frame appears. You used Render Image (
F12) instead of Render Animation, or the command line used-finstead of-a. - Frames are missing. Step is above 1, or Overwrite is off and an earlier run left files behind.
- The camera view is empty. The active camera points at nothing, or the objects are on a hidden collection. Check the camera before rendering.
- The animation does not move. The keyframes are on a different frame range than the render range, or the object's animation is not in the active scene.
- Files appear in an unexpected folder. A path without the
//prefix is treated as absolute. Use//for paths relative to the.blendfile, and save the file first, because an unsaved file has no location to be relative to.
Exercise
You want a PNG sequence of frames 10 to 60 from scene.blend, saved as //out/shot_00010.png and so on, with five-digit numbering. Write the command line that does this, and say what happens if you move -a before -o.
Show answer
blender -b scene.blend -o //out/shot_##### -F PNG -x 1 -s 10 -e 60 -a. Blender reads arguments left to right, so if -a comes before -o, the render starts with the path and settings stored in the file, and the later options are ignored for that render. The frames then go to the wrong folder or have the wrong names.
Exercise
A render of 240 frames stopped at frame 130 because of a power cut. The output folder holds 130 PNG files. How do you finish the job without re-rendering what exists, and what should you check first?
Show answer
Turn Overwrite off in the Output panel (or the equivalent in Python, scene.render.use_overwrite = False) and run Render Animation again with the same path. Blender skips frames whose files exist. Before you do, open or delete the last file written, frame 130, because a partly written file would be treated as complete and skipped.