Overview
Optical Flow compares the current frame with the adjacent frames (before and after) and computes, for each pixel, a displacement vector showing where that pixel appears to have gone. The result: a vector image stored in auxiliary channels (forward / backward vectors).
The node does not produce a visually modified image - it enriches the footage with motion data. That data is then used to interpolate in-between frames (slow motion), to apply motion blur that is faithful to the real movement, or for stylized warp effects through Vector Distortion.
Where to find this node
- Effects Library:
Tools > Optical Flow > Optical Flow - Quick add: right-click in the Node Editor →
Add Tool > Optical Flow > Optical Flow
How it works
The optical flow algorithm compares blocks of pixels between frame N and frame N+1 (or N-1) to estimate how they moved. Mathematically: minimizing the luminance error between patches.
- Output: forward vectors (FV)
- The direction where each pixel goes in the next frame. Used for forward interpolation.
- Output: backward vectors (BV)
- The direction where each pixel comes from in the previous frame. Used for backward interpolation.
- Typical limits
- It fails on: occlusions (a pixel appears / disappears), native motion blur (blurry textures), low contrast, fast motion (movement larger than the analysis window), rapid lighting changes.
Inputs
- Input (orange) - the video sequence to analyze. It needs at least 3 frames (the current frame + at least one before or after).
- Effect Mask (blue) - optional. Limits the analysis to an area (rare; it mostly makes sense for a Vector Distortion downstream).
Setup
Smooth slow motion:
MediaIn → Optical Flow → Time Stretcher (animated Source Time)
→ MediaOut
Motion blur in post:
MediaIn → Optical Flow → Vector Motion Blur (Shutter Angle 180°)
→ MediaOut
Optical Flow + Vector Distortion combo:
MediaIn → Optical Flow → Vector Distortion (animated Scale)
→ MediaOut
Cache so it is not recalculated on every frame:
MediaIn → Optical Flow (cache enabled)
→ [multiple uses]Controls tab
- Method (default: Classic)
- The analysis algorithm. Classic: fast, works well on moderate motion. Enhanced Better: more precise, much slower, recommended for final delivery.
- Smoothness (default: 0.4)
- Spatial smoothing of the motion vectors. Low = precise vectors that can be noisy. High = more consistent vectors but loss of detail in complex areas (hair, foliage).
- Edges (default: Smoother)
- Behavior at the frame edges. Smoother = soft transitions, Sharper = strict respect of the edges (can create artifacts).
- Correlation Search Range (default: 8)
- Maximum search distance for the analysis (in pixels). Raise it for fast motion (movements larger than 8 px). The CPU/GPU cost grows quadratically.
- Maximum Motion Magnitude (default: 8)
- Cap on the maximum magnitude of a vector. Adjust it based on the real speed of the elements (typical pixels/frame in the scene).
- Use Greyscale Color Space (default: Off)
- Enables a luma-only analysis. Faster, but loses the precision provided by chroma information on objects with little luminance difference.
Classic method (details)
When Method = Classic, specific controls appear in the panel to fine-tune the analysis:
- Proxy
- A proxy multiplier dedicated to tracking. Lets you analyze at a reduced resolution for performance, while keeping the final quality at render time.
- Smoothness
- Spatial smoothing of the vectors. Same as the global Smoothness, but specifically in Classic mode.
- Edges
- Smoother / Sharper / Mixed depending on the version. Behavior at the frame edges.
- Match Weight
- Weighting of pixel-to-pixel similarity in the matching. High = favors exact matches, low = tolerates more difference.
- Mismatch Penalty
- Penalty applied to poor matches. Raise it to reject doubtful matches aggressively (fewer false positives but it can create holes).
- Warp Count
- Number of warping iterations to refine the estimate. More = more precise, slower.
- Iteration Count
- Number of internal iterations per warp. More = more precision, slower.
- Filtering options
- Post-processing filters applied to the generated vectors (denoising, optional temporal smoothing).
Enhanced/Advanced method (details)
When Method = Enhanced Better (or Advanced depending on the version), a smaller but more powerful set of controls is exposed:
- Warp Count
- Warping iterations. Typically higher than in Classic mode to reach better precision.
- Iteration Count
- Internal iterations for convergence. More = quality, slower.
- Smoothness
- Spatial smoothing. Especially important in Advanced mode because the algorithm is more sensitive.
- Half Resolution (checkbox)
- When enabled, computes at half resolution for performance. Useful for previews, disable it for the final render.
Settings tab
The Settings tab is shared by all the Optical Flow nodes (Optical Flow, Repair Frame, Smooth Motion, Tween) and exposes common blending and masking controls:
- Blend (0.0 - 1.0)
- Mix between the original input image and the modified result. 0 = input pass-through, 1 = full effect.
- Process When Blend Is 0.0
- Processes the node even when Blend = 0. Useful for scripted operations that depend on the result.
- RGBA Channel Selectors
- 4 buttons (R / G / B / A) to limit the effect to specific channels. The filter is applied after processing.
- Apply Mask Inverted
- Fully inverts the mask channel applied to the tool.
- Multiply by Mask
- Multiplies the RGB values by the mask, making unmasked pixels black/transparent.
- Use Object / Use Material
- Enables the Object ID / Material ID channels of EXR files as masks. An associated slider selects the ID, plus a Sample button to pick it.
- Correct Edges
- Edge handling toggle for multi-object images through the Coverage and Background Color channels.
- Object ID / Material ID Sliders
- Selectors for a specific ID value. A Sample button captures an ID directly from the image.
- Hide Incoming Connections
- Hides the input wires for a cleaner node tree, while keeping the inputs active.
- Comments
- A field to annotate the node. Shown through a tooltip / small red indicator.
- Scripts
- 3 script fields for render-time operations (pre-render, render, post-render).
Use cases
- Smooth slow motion - 24fps footage → Optical Flow → Time Stretcher (50%) = 48fps interpolated through motion vectors instead of duplicated frames.
- Motion blur in post - footage shot without motion blur (high shutter speed) → Optical Flow → Vector Motion Blur = physically correct added blur.
- Frame rate conform - go from 24fps to 25fps, or 30fps to 60fps, without stutter or duplicates: Optical Flow + Time Stretcher = a smooth retime.
- Motion-based warp effects - Optical Flow + Vector Distortion = a stylized warp that follows the physical motion of the elements in the shot.
- Cinematic speed ramping - gradual slow downs and speed ups with an animation curve: OF + Time Stretcher with a curved Source Time = a Hollywood ramp effect.
- Smooth reverse motion - backward Time Stretcher + OF upstream = correctly interpolated reverse playback (vs raw reverse playback, which can stutter).
- Frame interpolation for stop motion - 12fps stop-motion animation → OF + Time Stretcher = interpolation to 24fps for a smoother render (at the cost of some stop-motion charm).
Tips
- Cache the Optical Flow - a heavy computation. Enable Cache to Disk in the node settings or right-click = Cache Selected Tool. It avoids recalculating on every downstream change.
- Enhanced Better only for the final - while compositing, stay in Classic (fast iteration). Switch to Enhanced Better just for the final render.
- Pre-denoising improves the analysis - very noisy footage → Remove Noise (subtle) → Optical Flow = more stable motion vectors.
- Raise the Search Range for fast motion - movement > 8 px / frame → bump it to 16 or 32. Beyond that, OF becomes unreliable anyway (switch to frame-blend interpolation).
- Smoothness 0.3-0.5 = the sweet spot - below that you get artifacts on edges, above it you lose fine detail (strands of hair).
- Check the vectors in debug - in the viewer, display the motion vectors as a heatmap (color overlay) to check they match the expected motion.
- Footage with native motion blur = a problem - OF struggles on frames that are already blurry. Prefer a reshoot with a high shutter speed, or disable OF on those sections.
- For motion blur only without a retime, you can use the
Vector Motion Blurnode, which includes its own internal Optical Flow - simpler and all-in-one.
