Skip to content

Vector video vs codecs

Vector video vs codecs

Can a video be turned into vector paths and beat a codec? For one kind of content perhaps; for camera video, no. This page gives the measured figures from the study, and go-avkit/vectorbench (v0.1.1) is the tool that repeats the measurement with pinned versions.

What was measured

Six lossless Xiph.org clips, the first 24 frames of each at native resolution. Raster side: x264 and x265 (-preset slow), SVT-AV1 (-preset 4), libvpx-vp9. Vector side: VTracer 0.6.5 run frame by frame, the SVGs rendered back by resvg. Quality is PSNR and VMAF against the source. Size is the video file, or the sum of the SVGs.

Every figure below is measured unless marked otherwise. This size study ran on a loaded machine (load about 97) and took no timings; the timings are in a second, separate run on a quiet host, described in Timings.

ClipBest trace (PSNR / VMAF)SVG bytes per frameCodec of higher PSNRBytes per frameSVG / codec
GlassHalf, 3D cartoon 1080p2431.5 dB / 55.61 669 226AV1 crf 60, 38.7 dB / 87.92 916about 570
SolLevanteFace, anime 1080p2435.1 dB / 47.03 886 018AV1 crf 45, 36.6 dB / 58.19 445about 410
Wikipedia, web page 1080p3024.5 dB / 30.11 419 519AV1 crf 60, 44.3 dB / 95.12 412about 590
Slides1, slides 1080p3027.4 dB / 57.81 353 515AV1 crf 60, 38.1 dB / 93.34 948about 270
KristenAndSara, fixed camera 720p6032.2 dB / 59.42 578 533x265 crf 40, 34.8 dB / 66.6621about 4 150
in_to_tree, texture and pan 720p5032.5 dB / 54.83 618 069AV1 crf 60, 35.4 dB / 84.71 372about 2 640

Conclusions

  • Frame-by-frame tracing is larger than the lossless PNG of the same frame on all six clips, while sitting 24 to 35 dB from the source. After gzip it is still 60 to 1 400 times the size of a better raster encode.
  • Coarser tracing does not close the gap: on SolLevanteFace the coarse setting is about 20 times larger than x264 crf 51 and worse.
  • Screen content is not the favourable case. Text that is already rasterised and anti-aliased is partly erased by the tracer’s speckle filter. Vectors win on screen content only when you start from the source (HTML, PDF), not from the video.
  • The one published vector win, about half the size of DivX 6 on flat 2D cartoons, was measured against a 2009 codec. Against HEVC or AV1 it is probably near 1 (estimated; nobody has republished it).
  • For resolution independence on camera video, use a raster codec with super-resolution at playback.

Run it yourself

vectorbench run --work <dir>        # writes results.json
vectorbench report results.json

vectorbench run refuses VTracer or resvg versions other than the pinned ones, fetches the clips by URL and checks their SHA-256, and records tool versions, the machine and the load in results.json. The report labels each number measured, estimated (interpolated between the two measured settings that bracket the target quality), a bound, or n/a. It also gives a flicker proxy: how many paths change between consecutive frames.

The tool refuses to time anything when the one-minute load is above its limit, unless a waiver reason is given, and the waiver is written into the results.

Timings

Published run: vectorbench v0.1.1, nine clips (the six above plus the screen recordings Debugging and MissionControlClip3 and the 1080p50 camera clip crowd_run), 24 frames each, on host fractal (Linux amd64), the process pinned to one core (taskset -c 9), one-minute load 1.77 at the start and 2.05 at the end (limit 8). Encoders: Ubuntu ffmpeg 6.1.1 (x264, x265, SVT-AV1 1.7.0, libvpx-vp9); PSNR and VMAF: a static ffmpeg 7.0.2 with libvmaf. VTracer 0.6.5 and resvg 0.50.0. The tool hashes and the raw results are in results/fractal-core9.json and the full tables in results/fractal-core9.md.

Encode time is the wall time of the encoder for the 24 frames, in seconds, at the mid-quality setting of each codec. VTracer is the default preset, in seconds per frame (multiply by 24 to compare). All measured, one run each.

Clipx264 crf 23x265 crf 23SVT-AV1 crf 45VP9 crf 50VTracer, s per frame
GlassHalf, cartoon 1080p1.20.914.26.20.85
SolLevanteFace, anime 1080p3.71.438.29.62.40
Wikipedia, screen 1080p0.60.616.63.40.82
Slides1, screen 1080p0.90.813.44.90.83
Debugging, screen 1080p0.60.617.74.20.69
MissionControlClip3, screen 1080p1.00.829.04.41.87
KristenAndSara, camera 720p0.50.57.01.60.54
in_to_tree, camera 720p0.90.611.81.92.64
crowd_run, camera 1080p3.21.667.811.511.76

Tracing 24 frames takes 13 to 282 seconds, against 0.5 to 4 seconds for x264 and x265 and 7 to 68 seconds for SVT-AV1 at this preset. Vectorising is therefore slower than the fast codecs by one to two orders of magnitude and comparable to the slowest AV1 setting, for a result that is larger and further from the source.

The same run gives the size comparison at matched VMAF. The ratio is the size of the trace divided by the size of the best codec at the same VMAF (plain SVG; the codec size is estimated by interpolation, or a bound where marked in the full tables), over every clip and VTracer setting of the class:

ClassComparisonsSmallestMedianLargest
anime418x625x1061x
cartoon4141x612x952x
natural12114x2164x6478x
screen1637x534x3429x

Even the coarsest trace is at least 18 times larger than a codec at its quality; the conclusion above stands on nine clips.