← Blog

One graph, three ffmpeg commands

Article · 2026-10-06

A Chroa graph is not a picture of an ffmpeg filter chain. It is compiled into ffmpeg arguments, and the same graph is compiled three separate times, for three different jobs.

A graph is data, not UI

Node definitions carry no React. A node declares its shape (the ports it accepts, the controls it draws, the category it is filed under) and nothing about how a card looks. The editor is what paints a node and measures the wires around it; the graph itself is only nodes, wires, and values. That separation is the reason the same graph can be handed to three different compilers without the editor being involved in any of them.

The plan comes first

Compilation begins by walking the graph into a plan: what gets read, what gets filtered, what gets written. The plan is the intermediate form the argument builders agree on, which is why they can differ so much in their tails while producing the same picture.

Three tails on one graph

Emitter What it produces What it is for
preflight the same filter graph, ending in one seeked frame written as a JPEG failing in two seconds instead of forty minutes
proxy the graph at a capped size, encoded for scrubbing a canvas you can actually move around in on heavy footage
render the graph at full quality the file you keep

They share one filter-graph builder on purpose. A preflight that took a different path through the graph would be a preflight of something else — so the preflight emitter builds the same graph as a render and changes only its tail. Every input is seeked, not just the first one: with two files on one command line, a frame is only a frame if both of them are at the same moment.

The proxy, as an argument list

The proxy is the clearest case of a decision written down as arguments rather than as preference. These are the emitter’s own constants:

scale=-2:'min(720,ih)'
-c:v libx264 -preset ultrafast -crf 30
-g 24 -pix_fmt yuv420p
-c:a aac -b:a 128k
-movflags +faststart -f mp4

Each of those is doing a job:

  • The height is capped and never raised. The aspect ratio decides the width; a small file is not blown up into a bigger one, because an upscaled preview costs decoding time and shows nothing that was not already there.
  • 720 is the number that decides whether a proxy is worth making at all: enough to judge a grade or see where an overlay sits, small enough that a whole clip is seconds of encoding rather than minutes.
  • -g 24 is there because a preview gets scrubbed. Left to itself, x264’s keyframe interval makes a seek decode up to eight seconds of footage.
  • -pix_fmt yuv420p is stated rather than left to the encoder: a 10-bit source would otherwise come out in a format the player may refuse, and a proxy nobody can play is not a proxy.
  • +faststart puts the index in front, so the player can reach the whole file from its first range request.

A preflight is not an instrument

What comes out of a preflight is eight-bit, subsampled, and lossy. That is the right shape for a picture to look at and the wrong one for comparing pixels. Range and colour-space questions are read off the asset inspector’s own rows, never off a preview. A limited-range frame is expanded on the way out to a JPEG, because a JPEG has no range of its own and every reader of one takes 0–255 for the whole scale.

The consequence is worth knowing before it is discovered: for a limited-range frame, that expansion and a set-range node do the very same thing. A preview cannot tell you what a range option did.

This describes the compiler as it exists in Chroa 1.0.1. The argument lists quoted above are the emitter's own constants, not reconstructions. Where this piece describes intent rather than mechanism, that is a reading of the code; the code is the authority.