For overlays made as numbered SVG frames (for example primitive output, see related-tools/, or frames exported from a vector tool): rasterize each SVG to PNG keeping transparency, then encode a ProRes 4444 movie with an alpha channel that editors can layer over other footage.
Step 1: rasterize. Most ffmpeg builds can't read SVG directly (that needs one built --enable-librsvg), so ImageMagick does it: magick -background none keep the transparent background -density 96 rendering resolution (raise for sharper frames before scaling up)
Step 2: encode. -framerate 15 -i png/%05d.png read frames 00001.png, 00002.png, … at 15 fps scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080 -r 29.97 -an -c:v prores_ks -profile:v 4 ProRes 4444, the profile that carries alpha -alpha_bits 8 8-bit alpha (the default 16 is rarely needed) -vendor apl0 tag as Apple-encoded for NLE compatibility -pix_fmt yuva444p10le 10-bit 4:4:4 plus alpha
With an ffmpeg built with librsvg, skip step 1 and read the SVGs directly: -framerate 15 -i %05d.svg.
The command
shopt -s nullglob
mkdir -p png
for f in *.svg; do
magick -background none -density 96 "$f" "png/${f%.svg}.png"
done
ffmpeg -framerate 15 -i png/%05d.png \
-vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" \
-r 29.97 \
-an \
-c:v prores_ks -profile:v 4 -alpha_bits 8 -vendor apl0 -pix_fmt yuva444p10le \
output.mov When to use it
Use this when an overlay exists as numbered SVG frames, from primitive or a vector tool, and an editor needs it as a movie with real transparency. If you don't need alpha, ProRes 4444 makes very large files for no benefit. The header explains each flag.
Common changes:
- Set
-framerate 15to the rate the animation was drawn at, and-r 29.97to your project's rate. - Change
1920:1080in both the scale and the crop to match your timeline. - Raise
-density 96if frames look soft after scaling up. - With an ffmpeg built with librsvg, skip the ImageMagick loop and read
%05d.svgdirectly.
If the background comes out black or opaque, open a few files in png/ and check that they are transparent. If ffmpeg finds no input, check that the SVGs are named 00001.svg, 00002.svg and so on. If edges are missing, your frames aren't 16:9. The crop fills the frame by trimming whatever overhangs.
Notes
- Source
- ffmpeg-utilities/notes/commands2.txt
- Changed
- fixed "prores_ks-profile:v 4" (missing space); added the ImageMagick step for ffmpeg builds without librsvg; -r 15 before -i → -framerate 15