Skip to content

The last step of a generated clip: GPU interpolation in FFmpeg 9.1

FFmpeg 9.1 adds motion-compensated interpolation on the GPU through Nvidia's optical-flow extension, plus a zero-copy NVDEC to NVENC path. Where that helps a generated clip, and where it still invents.

AI-assisted draft. Reviewed and edited by the Phosphene team before publication.

On this page
A 35mm projector gate in a dark room, one frame held sharp inside the gate and two faint ghost frames hovering just outside it, dust caught in the beam
Editorial illustration about frame interpolation in a video toolchain; not a screenshot, a benchmark, or a frame from a generated clip.

Say a five-second generation comes out at 16 frames per second: eighty frames. A player, a client, or a broadcast spec wants 24 or 30. That gap is usually closed outside the generation tool: RIFE behind some interface, Topaz, Flowframes, a phone app, or a colleague who knows which buttons to press. FFmpeg 9.1, released a few days ago under the name Gauss, moves the step into the same binary that already trims, scales, and encodes the clip. The new filter is called fruc_vulkan, and it does the interpolation on the GPU.

The release is long, and most of it concerns codecs that never touch a generated frame. A handful of changes matter if you ship AI video, and the interpolation filter is the one that changes how the output looks.

What the filter actually does

heise's write-up of the release describes fruc_vulkan as raising the frame rate through interpolation rather than by repeating existing frames. It estimates motion between two frames and builds new frames from that estimate. The motion analysis runs through Nvidia's Vulkan extension VK_NV_optical_flow; the interpolation itself is implemented in FFmpeg's own code.

Two consequences follow. Any Vulkan-capable card is not enough: the GPU has to expose that specific Nvidia extension, so this is an Nvidia path with Vulkan plumbing. And because motion estimation comes from the driver while interpolation comes from FFmpeg, the result is a compound of two components you cannot tune as one.

There is a second gate, and it is visible in the filter's source. The device also has to support VK_KHR_maintenance9, and the FFmpeg build has to include the filter at all. The filter logs which piece is missing, so a stock build on a card that does expose optical flow can still fail for a reason that has nothing to do with the driver.

Frame doubling and motion compensation are different tools

Doubling a frame preserves timing and destroys motion. Every second frame is a copy, so a pan judders and a hand jumps. Nobody ships that, which is why interpolation got popular in the first place.

Motion compensation guesses what happened between two frames and draws it. On footage that came out of a camera, that guess is usually good, because the sensor recorded a continuous world at a fixed shutter. On generated footage the same guess runs into a specific problem: consecutive frames of a diffusion video are not samples of one physical scene. They are two independent attempts at looking like one, and where the model was uncertain, the frames disagree. Texture breathes, a strand of hair changes length, freckles migrate.

An interpolator reads that disagreement as motion. It will happily produce a frame where the disagreement is halfway resolved, which is why interpolated AI footage sometimes looks worse than the raw output at low frame rate: you get smooth timing over a subject whose surface is quietly rearranging itself.

The four places it breaks

Worth checking before you interpolate a whole clip:

  • Occlusion. A hand passing in front of a face hides part of it in frame one and reveals something else in frame two. The estimator has no idea what was behind the hand, so the in-between frame gets a smear or a doubled edge. Generated close-ups with a raised hand are the classic case.
  • Disocclusion. The reverse: background that was covered becomes visible. Same failure, different side.
  • Thin structures. Hair strands, wires, glasses frames, chain links, lace. Optical flow needs texture it can track, and a two-pixel-wide line has almost none. It bends.
  • Global fast motion. A whip pan or a full-frame shake moves everything at once, and every vector is at the edge of what the estimator can resolve. Interpolated whip pans tend to slide rather than blur.

The cheap test: export the interpolated version, pause on the frames that did not exist before, and look at hands, hair, and any text in the scene. Add the cut boundaries to that check, because fruc_vulkan has no scene-change detection: point it at a clip with a hard cut and it will interpolate across the join, blending two shots into a frame that belongs to neither. Hands, hair and text can all look clean while the cut smears. If the clip has cuts, split it at them and interpolate the shots separately. If those checks survive, the pass is fine. If you cannot pick out the inserted frames at all, the interpolation worked, or the shot was slow enough that it did not need the help.

The rest of the release, filtered for people who ship video

  • Zero-copy on the Nvidia transcode path. Block-linear CUDA surfaces, the so-called CUDA arrays, can now go straight from the NVDEC decoder to the NVENC encoder without the intermediate copy into a different GPU memory layout. The path needs interfaces from Video Codec SDK 13.1 or newer. This is throughput, not quality: fewer copies per clip, which matters when you are encoding a batch of takes rather than one.
  • Zero-copy inference on Windows. The ONNX Runtime backend of the DNN filters gains a D3D12/DirectML zero-copy path, so frame data for inference can stay in GPU memory instead of shuttling to system RAM. Relevant if your finishing chain includes a filter model, less so if your model lives in ComfyUI.
  • AMD gets a new enhancement stage. vqe_amf wraps the image enhancement of the Advanced Media Framework with an adjustable strength, and it is the AMF addition in this release. The frame-rate converter beside it, frc_amf, is older: it shipped in 9.0, so nobody on Windows needs to upgrade for that one. A second vendor's enhancement stage inside FFmpeg, with the usual caveat that sharpening is a taste decision, not a repair.
  • HDR stills move. A new gainmap filter computes a gain map from two image variants, and a JPEG-MPF muxer stores the base JPEG and the gain-map JPEG together in one file, with a matching demuxer. A gain map describes how to convert the base image into an alternative rendering, SDR to HDR being the obvious one. For a portfolio export or a print handoff this is the first sane container in FFmpeg for "same picture, two brightness ranges".
  • Audio, if you generate it too. The native AAC encoder got reworked bitrate control, stereo bit allocation, and psychoacoustics; under 80 kbit/s in stereo it now points you at -ar 32000 instead of silently producing mush. xHE-AAC arrives through the external libfdk-xhe-aac library, which has to be compiled in, because the native encoder does not cover it.
  • Pro and delivery formats. APV, the codec aimed at professional recording and post workflows, gains a Vulkan-based GPU encoder to sit beside the Vulkan decoder added in 9.0. LCEVC payloads carried on separate tracks can now be merged back with the base stream by a bitstream filter, and the MPEG-TS muxer can write LCEVC tracks. A new opt-in HTTP client built on libcurl brings HTTP/2, HTTP/3, and SOCKS5 proxy support behind prefer_libcurl; the old client stays the default.
  • Three-dimensional pipelines. ASTC texture compression can now be encoded and decoded through libastcenc, with .astc and KTX-1.0 file support. If you move generated images into a 3D scene or a game engine, that is one of the formats they end up in.
  • Smaller items worth knowing about. macOS can select AVFoundation input devices by unique ID or USB serial number, which finally distinguishes two identical capture cards. H.264 decoding handles data partitioning. New decoders cover Panasonic RW2 raw photos and DVD-Audio LPCM. The asf_o demuxer is gone; ASF support as a whole is not.

Where it belongs in a generation pipeline

The useful pattern is the one that keeps generated frames as the source of truth. Generate at whatever frame rate the model is comfortable with, keep that master untouched, and interpolate a copy at the end for the platform you are delivering to.

Two ordering decisions are mine rather than the release's, and worth flagging as such:

  • Interpolate before grain, after upscale. Film grain is high-frequency noise that changes every frame, which is the worst possible input for a motion estimator. Add it after interpolation. Upscaling first is a quality argument: interpolation on a larger frame has more texture to track, though it also costs more time.
  • Ask for the rate you actually need. Going 16 to 32 is clean arithmetic, and it is a reasonable default because every second frame is a real one. Just do not reach a different target by reinterpreting timestamps afterwards: 160 frames played at 30 fps runs 5.33 seconds, and audio cut to the original five will drift. The filter takes the output rate as an option (fps, a rate expression, default 60), so ask for 30 directly and let it place the new frames on evenly spaced timestamps.

FFmpeg was never without interpolation: minterpolate has done motion-compensated work on the CPU for years, and it is slow enough that most people reached for a separate GPU tool instead of finishing the clip in a filter chain. What 9.1 changes is where the work runs, not whether FFmpeg could do it. A five-second clip becomes one filter in a chain you already have rather than an export, an external run, and an import, and the temptation to ship the judder gets weaker.

The catch is the one from the top: the filter needs an Nvidia GPU with both of those Vulkan extensions. On an AMD card or a Mac, fruc_vulkan is not available. AMD has had a path of its own since 9.0: frc_amf doubles the frame rate through the Advanced Media Framework on Windows, with DX11 or DX12 as the engine and a fallback that duplicates or blends frames when interpolation confidence drops. Doubling is all it does, so it covers 16 to 32 and not a 30 fps target. Everywhere else the choice is FFmpeg's own CPU minterpolate, which is slow, or the external tool. The release notes do not include a quality comparison against RIFE or Topaz, so treat these filters as newly convenient rather than newly better. I have not benchmarked them; what is published here is the release's own description plus the reasoning about where interpolation fails.

Interpolation is a delivery decision. It cannot fix a wrong frame, cannot recover detail the model never drew, and cannot tell you that a clip is broken. It can only decide whether the clip plays at the rhythm a viewer expects. Having that decision inside FFmpeg does not make it free of judgment. It just moves it one step closer to the export button.

Sources

Share this guide
X LinkedIn