Sub topic 12
Turning an image sequence into a video with the Video Sequencer
You already have a folder of numbered frames from an animation render, such as frame_0001.png through frame_0048.png. This chapter turns them into one video file without re-rendering the 3D scene. It assumes you have rendered an image sequence (see the earlier chapter on animation renders), know where the Properties editor's Output tab is, and can switch workspaces. The scripted part also assumes you can run a Python file in Blender.
Why assemble frames instead of rendering straight to video
Rendering straight to a video file is quick, but it has a cost. If the render crashes at frame 900, you often have no usable file. A video also compresses each frame as it goes, so you can't fix a bad encoder setting without rendering again.
An image sequence avoids both problems:
- Each frame is a separate file, so you can resume an interrupted render.
- The frames are lossless if you use PNG or OpenEXR, so you can encode them as many times as you like with different codecs, sizes, or quality levels.
- You can re-encode at a different frame rate or trim the ends without touching the 3D scene.
The Video Sequencer (also called the Video Editing workspace) is Blender's built-in editor for this. It places media on a timeline as strips and can render that timeline to a file.
Adding the image sequence as one strip
- Open the Video Editing workspace from the tabs at the top of the window. If it is missing, add it with the + tab at the end of the row, under Video Editing.
- In the sequencer area, choose Add > Image/Sequence.
- In the file browser, go to your frames folder. Press
Ato select all the images, or click the first one and Shift-click the last. - Confirm with Add Image Strip.
The result is a single strip whose length equals the number of selected files. The strip's name comes from the first file. Open the sidebar with N and check the Strip tab. The Source panel shows the directory and file list, and the strip's duration should match your frame count.
The strip starts at the current frame, which is rarely frame 1. Set the strip's start in the sidebar to 1, or move the playhead to frame 1 before you add it.
A single stray file in the same folder can cause trouble. If you select with A, you get every image in the directory, including leftover frames from an older render. Delete or move stale files first, or select only the range you want.
Matching frame rate and frame range to the strip
Blender does not read a frame rate from PNG files, because still images don't carry one. The video's rate comes from the scene, and the length comes from the scene's frame range.
| Setting | Where | What it must match |
|---|---|---|
| Frame Rate | Output properties > Format | The rate the animation was designed for, such as 24 |
| Frame Start | Output properties > Frame Range | The strip's first frame, usually 1 |
| End | Output properties > Frame Range | The strip's last frame |
| Resolution X / Y and % | Output properties > Format | The pixel size of your frames, unless you want scaling |
The end frame is the one people get wrong. A strip that starts at 1 and holds 48 images occupies frames 1 to 48. If the scene's End is still 250 from the default, the video will have 202 extra frames of black. If End is too low, the tail of the animation is cut off.
If the frame size of the strip differs from the scene resolution, the strip is scaled or cropped according to its Fit Method (in the strip's Transform settings). Fit keeps the whole image and adds bars if needed. Check the preview in the sequencer before rendering.
Turning on the Sequencer for output
This is the step most likely to produce a wrong result. Blender decides what to render from the scene's Post Processing settings in the Output tab:
- Sequencer on: the output is the sequencer timeline. If the timeline has strips, Blender renders those and skips the 3D scene.
- Sequencer off: Blender renders the 3D scene from the active camera and ignores your strips.
When you create a strip in the Video Editing workspace the option is usually on, but a scene from another file may have it off. If you get a render of your 3D scene instead of your frames, or the reverse, this checkbox is the first thing to check.
Because the sequencer can replace the 3D render, rendering the timeline is fast. Blender only reads the images and encodes them.
Choosing the video encoding
In Output properties > Output, set File Format to FFmpeg Video. Then set the Encoding panel:
- Container: MPEG-4 gives an
.mp4file that plays almost everywhere. Matroska (.mkv) is a safer choice if you want to keep a render that may be interrupted, because the file stays readable if it is cut off. - Video Codec: H.264 is the default choice for compatibility. It is lossy, so it gives smaller files than the PNG frames you started with.
- Output Quality: Constant Rate Factor (CRF) presets from Lossless to Very low. Medium is a sensible default for a draft.
- Encoding Speed: slower presets make a smaller file at the same quality.
- Audio Codec: set to No Audio unless you added a sound strip.
If you want a lossless or near-lossless master, use a higher-quality preset. Keep the PNG frames around as your true master and treat the video as a delivery copy.
The output path is a base name. With FFmpeg Video, Blender writes a file named from the path plus the frame range, for example final_0001-0048.mp4, unless the path already ends with a file extension. Setting //renders/final_ is fine.
Color management on strips
The images in the sequencer carry their own color space. For 8-bit PNG files saved from Blender, that is normally sRGB, and you can see the setting in the strip's Source panel under Color Space.
A common mistake is to render frames with a view transform such as AgX or Filmic, then bring them into the sequencer where a view transform is applied again. The result looks washed out or too dark. Two ways to avoid it:
- Keep the frames sRGB and set the sequencer's color handling so the view does not tone-map them again. In the Color Management panel, Sequencer is set to sRGB by default, which works for ordinary 8-bit frames.
- If you saved scene-linear OpenEXR frames, set the strip's color space to the matching linear option so the view transform treats them as intended.
If the video looks different from the frames in an image viewer, color management is the likely cause.
Doing it from a script
You can build the same strip in Python, which is useful when you have to assemble many shots. This script reads the frames from //renders, makes a strip, matches the scene, and encodes an MP4. Save your .blend first, because // paths need a saved file.
In Blender 5.0 and later the collection is named strips. Earlier versions call it sequences. The script handles both.
import os
import bpy
scene = bpy.context.scene
folder = bpy.path.abspath('//renders')
files = sorted(
f for f in os.listdir(folder)
if f.startswith('frame_') and f.endswith('.png')
)
if not files:
raise SystemExit('No frame_*.png files found in ' + folder)
if scene.sequence_editor is None:
scene.sequence_editor_create()
editor = scene.sequence_editor
strips = getattr(editor, 'strips', None) or editor.sequences
strip = strips.new_image(
name='shot',
filepath=os.path.join(folder, files[0]),
channel=1,
frame_start=1,
)
for name in files[1:]:
strip.elements.append(name)
scene.frame_start = 1
scene.frame_end = strip.frame_final_end - 1
scene.render.fps = 24
scene.render.use_sequencer = True
scene.render.image_settings.file_format = 'FFMPEG'
scene.render.ffmpeg.format = 'MPEG4'
scene.render.ffmpeg.codec = 'H264'
scene.render.ffmpeg.constant_rate_factor = 'MEDIUM'
scene.render.ffmpeg.audio_codec = 'NONE'
scene.render.filepath = '//renders/final_'
bpy.ops.render.render(animation=True)frame_final_end is the first frame after the strip, so the script subtracts 1 to get the last frame. The first image's name is used to create the strip, and the loop appends the remaining files as elements of that same strip. If you run the script twice on the same scene, you add a second strip on top of the first, so delete the old strip or start from a clean file.
To render a saved .blend that already contains this setup without opening the interface, use the command line. The settings come from the file, so only -a is needed:
blender -b edit.blend -aCommon problems
- Black frames at the end. The scene End frame is beyond the strip. Set it to the strip's last frame.
- The video shows the 3D scene. Post Processing > Sequencer is off, or the strip is muted.
- Wrong speed. The scene frame rate differs from the one you intended. Frames are shown one per frame, so a 48-frame strip at 24 fps lasts two seconds.
- Washed-out colors. A view transform is being applied twice. Check the strip's color space.
- Missing or extra frames. The file selection included stale images, or a gap in the numbering exists.
Exercise
You have 72 PNG frames, frame_0001.png to frame_0072.png, and you add them as one strip starting at frame 1. The scene is set to 30 fps, End is 250, and Post Processing > Sequencer is on. You render to FFmpeg MPEG-4 H.264. What problems will the video have, and what do you change to get a 3-second video from these frames at 24 fps?
Show answer
With End at 250 the video has 250 frames, so the last 178 are black. At 30 fps the 72 frames also play in 2.4 seconds instead of the intended speed. Set the frame rate to 24 and the End frame to 72. That gives 72 frames at 24 fps, which is exactly 3 seconds.