Sub topic 9
Setting the frame range and frame rate
This chapter covers the two settings that decide which frames Blender renders and how fast they play back. It assumes you can find the Output properties tab and the Timeline, and that you have a scene with keyframed animation. Earlier chapters covered resolution, file formats and output paths. Later chapters use the range and rate you set here to render an image sequence and a video.
Frames, not seconds
Blender stores animation in frames. A keyframe sits at frame 37, not at 1.54 seconds. The frame rate (fps) converts frames to seconds only when you play the animation back or encode it to video.
Two numbers define what an animation render produces:
- The frame range selects which frames are rendered.
- The frame rate sets how many of those frames play per second.
Changing the range changes how much footage you get. Changing the rate changes how long that footage lasts and how fast the motion looks. Neither changes the keyframes.
The Frame Range settings
Open Output properties and expand the Frame Range panel. It has four settings:
| Setting | Python property | Meaning |
|---|---|---|
| Frame Start | `scene.frame_start` | First frame rendered |
| End | `scene.frame_end` | Last frame rendered, included |
| Step | `scene.frame_step` | Render every Nth frame |
| Frame Rate | `scene.render.fps` and `scene.render.fps_base` | Playback speed |
The Start and End fields in the Timeline header edit the same frame_start and frame_end values. Changing them in either place changes both.
The end frame is included
Both ends of the range are rendered. Frames 1 to 120 give 120 frames, not 119. In general:
frame count = frame_end - frame_start + 1Off-by-one mistakes are common when you compute a duration by hand. A range of 1 to 24 at 24 fps is exactly one second. A range of 0 to 24 is 25 frames, which is one second plus one extra frame.
Step
Step renders every Nth frame in the range. With Start 1, End 10 and Step 3, Blender renders frames 1, 4, 7 and 10. Step is useful for quick motion tests, because it cuts render time by roughly the step factor.
The finished video plays the rendered frames at the full frame rate. A step-3 render therefore plays in about a third of the time and looks three times faster. Step is a preview tool, not a way to change the animation's speed. Leave it at 1 for final output.
The preview range does not affect rendering
The Timeline has a clock icon that turns on a preview range. It limits playback to a section of the timeline, and the timeline shows it with a different color. It is stored separately as scene.frame_preview_start and scene.frame_preview_end. An animation render uses frame_start and frame_end, not the preview range.
Use the preview range to loop one action while you tweak it. If your render covers the wrong frames, check that you edited the real Start and End and not the preview range.
Choosing a frame rate
The Frame Rate menu in Output properties offers presets. Blender stores the rate as two numbers: fps and fps_base. The effective rate is fps / fps_base.
| Preset | fps | fps_base | Effective rate |
|---|---|---|---|
| 24 | 24 | 1.0 | 24.000 |
| 23.98 | 24 | 1.001 | 23.976 |
| 25 | 25 | 1.0 | 25.000 |
| 29.97 | 30 | 1.001 | 29.970 |
| 30 | 30 | 1.0 | 30.000 |
| 50 | 50 | 1.0 | 50.000 |
| 59.94 | 60 | 1.001 | 59.940 |
| 60 | 60 | 1.0 | 60.000 |
Choose the rate by where the video will be shown:
- 24 or 23.98 is the usual choice for film-style animation.
- 25 or 50 is the standard in PAL regions.
- 30, 29.97, 60 or 59.94 is the usual choice for web video and screen capture.
Choosing Custom in the menu shows the FPS and Base fields directly. Set Base to 1.0 unless you need one of the fractional broadcast rates.
Changing fps after animating
Changing the frame rate does not move any keyframes. A character who walks across the screen between frames 1 and 48 still does so. At 24 fps the walk takes 2 seconds. If you change to 48 fps, it takes 1 second, and the motion looks twice as fast. If you need the same real-time motion at a higher rate, you must also stretch the keyframes. Pick the frame rate before you start animating when you can.
The frame rate also matters when the animation has sound. Audio is placed in time by seconds, so a different fps shifts which frame each sound lines up with.
Calculating duration and checking the result
Compute the duration before you start a long render:
duration (seconds) = frame count / (fps / fps_base)For frames 1 to 120 at 24 fps, that is 120 / 24 = 5 seconds. The following script sets the range and rate, then prints the frame count and duration. It accounts for step and for fractional rates.
import bpy
scene = bpy.context.scene
scene.frame_start = 1
scene.frame_end = 120
scene.frame_step = 1
scene.render.fps = 24
scene.render.fps_base = 1.0
frames = list(range(scene.frame_start, scene.frame_end + 1, scene.frame_step))
effective_fps = scene.render.fps / scene.render.fps_base
seconds = len(frames) / effective_fps
print(f"Frames to render: {len(frames)}")
print(f"Frame rate: {effective_fps:.3f} fps")
print(f"Duration: {seconds:.2f} s")Run it from the Scripting workspace. For this scene it prints 120 frames, 24.000 fps and 5.00 s.
Setting the range from the command line
When you render in the background, the command line can override the range stored in the .blend file for that one run. The relevant options are:
-ssets the start frame.-esets the end frame.-jsets the frame step. Blender calls it the frame jump.-arenders the animation.
Options are processed in the order you give them. Put -s, -e and -j before -a, because -a starts rendering at the point where Blender reads it.
blender -b scene.blend -o //renders/frame_#### -F PNG -x 1 -s 1 -e 48 -aThis renders frames 1 to 48 as a numbered PNG sequence. To render every second frame as a quick test, add -j 2 before -a:
blender -b scene.blend -o //renders/test_#### -F PNG -x 1 -s 1 -e 48 -j 2 -aThe command line has no option for the frame rate. For a PNG sequence this does not matter, because image files carry no frame rate. It matters when the output is a video, because the encoder reads the rate from the scene. Set the rate in the file or in a Python script before you render a video from the command line.
Common problems
- The render has too many or too few frames. Compare
frame_startandframe_endin Output properties to the Timeline. A preview range, or an old range left over from a previous shot, is the usual cause. - The video plays too fast or too slow. The frame rate is wrong. A mismatch between the rate you animated for and the rate you rendered at changes playback speed directly.
- Motion looks sped up in a test render. You probably left Step above 1. Set it back to 1.
- Frames are missing from the folder. Check Step first, then check whether the output file name pattern overwrites earlier frames. Output paths are covered in the previous chapter.
- The animation ends early. Keyframes after
frame_endare ignored by the render. Extend the end frame to include the last pose.
Exercise
A scene has Frame Start 10, End 130, Step 1 and a frame rate of 24 fps. (a) How many frames does an animation render produce? (b) How long is the video in seconds? (c) You change Step to 2. How many frames are rendered now, and how long does the video run if the frames play at 24 fps?
Show answer
(a) The end frame is included, so the count is 130 - 10 + 1 = 121 frames. (b) 121 / 24 is about 5.04 seconds. (c) With Step 2 the frames are 10, 12, 14 and so on up to 130, which is 61 frames. At 24 fps they play for 61 / 24, about 2.54 seconds, so the motion looks about twice as fast.
Exercise
Write the command that renders frames 20 to 60 of scene.blend as a PNG sequence named shot_0020.png and so on in the folder renders next to the file. Why must -s and -e come before -a?
Show answer
blender -b scene.blend -o //renders/shot_#### -F PNG -x 1 -s 20 -e 60 -a. Blender reads the options in order, and -a starts the render as soon as it is read. If -s and -e came after it, the animation would already have rendered with the range stored in the file.