Skip to content

About

Reproducible benchmark: frame-by-frame vectorisation (VTracer) against x264, x265, SVT-AV1 and VP9 at matched PSNR and VMAF

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

vectorbench

Does vectorising a video frame by frame (VTracer) beat a video codec at the same quality? vectorbench answers it per content class: cartoon, anime, screen content and natural camera footage. It compares VTracer with x264, x265, SVT-AV1 and VP9 at matched PSNR and matched VMAF.

It records what it measured, with which tools, on which machine, at which load. A figure that is interpolated between two encoder settings is marked est.; a figure that is only a bound is marked <=; a quality no setting reached is n/a. Nothing is rounded into a measured value.

go install github.com/go-avkit/vectorbench/cmd/vectorbench@latest

vectorbench pin    --work DIR                 # fetch the clips, print their SHA-256
vectorbench run    --work DIR --frames 24     # measure, write DIR/results.json
vectorbench report DIR/results.json           # Markdown tables

Tools

Tool Pinned Install
VTracer 0.6.5 (MIT) cargo install vtracer --version 0.6.5 --locked
resvg 0.50.0 (MPL-2.0, rasterises the SVG for scoring) cargo install resvg --version 0.50.0 --locked
ffmpeg any recent build with libx264, libx265, libsvtav1, libvpx-vp9 and libvmaf its version string is stored in the results

run refuses a VTracer or resvg of another version unless --allow-unpinned-tools is given, and then stamps the difference into the results. ffmpeg is not pinned (distributions differ); its full version line and the encoder library versions are recorded instead. When no single ffmpeg has the encoders and libvmaf, --ffmpeg-quality BIN names a second build that only measures PSNR and VMAF; its version is recorded as ffmpeg_quality.

Clips

The manifest (internal/bench/clips.json) lists Xiph.org clips by URL and SHA-256. Clips are never committed: run fetches the header and the first 24 frames with a Range request, hashes those bytes and refuses a mismatch (a missing hash is also a refusal). vectorbench pin fills the hashes in; the first pin trusts the server once, so read what it fetched. Classes: cartoon (GlassHalf), anime (SolLevanteFace), screen (Wikipedia, Slides1 and the screen recordings Debugging and MissionControlClip3) and natural camera footage (KristenAndSara, in_to_tree and crowd_run, a real 1080p50 clip).

What is measured

  • Size: encoded bytes; for vectors, the SVG bytes and their gzip size.
  • Quality: PSNR and VMAF (libvmaf, n_threads=4) of the decoded or rasterised frames against the source frames.
  • Time: wall and CPU seconds of each encoder process and of the VTracer process (sum over frames). The load average is read before the first run and after the last, and stored. The run refuses to start above --max-load (8); --load-waiver REASON overrides it and stamps the reason into the results. Pin the process to one core (taskset -c N) and say so with --note.
  • Flicker proxy: path churn between consecutive frames, below.

Flicker proxy

Frame-by-frame vectorisation has no temporal model, so the paths of frame N+1 need not resemble those of frame N. For each consecutive pair, the paths of the two SVGs are matched one to one, largest first, when their bounding boxes have an IoU of at least 0.5 and their fill colours differ by at most 32 (Euclidean RGB). churn is the fraction of paths that find no partner (1 - 2*matched/(n_prev+n_cur)); the report also gives the unmatched area and the mean centre shift of matched pairs. It is a proxy: it uses bounding boxes and fills, not outlines, and says nothing about how visible a change is. Zero means the structure is stable, not that the picture is.

Limits

Prefixes of 2 to 24 frames, not whole clips: it measures per-frame cost and quality, not rate control over a long GOP. Encoders run at fixed CRF settings, so matched-quality sizes are interpolated (log size against quality) and marked.

Results

results/ holds the published results JSON, each with its tool versions, machine and load, and its rendered report.

  • results/fractal-core9.json and results/fractal-core9.md: all nine clips, 24 frames each, on host fractal (Linux amd64) with the process pinned to core 9 (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, because no single build there had both (--ffmpeg-quality). VTracer 0.6.5 and resvg 0.50.0; the sha256 of the three binaries is in the note of the file.

The discussion is on the docs page "Vector video vs codecs" of go-avkit/docs.

Licences

The program is MIT. VTracer is MIT and resvg is MPL-2.0; both are run as separate programs, never linked or vendored. No GPL tracer source was read or used.

About

Reproducible benchmark: frame-by-frame vectorisation (VTracer) against x264, x265, SVT-AV1 and VP9 at matched PSNR and VMAF

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages