Skip to main content

pyvideotools : Quality Metrics & Video Encoding

WIP

Python utilities for video quality measurement and video encoding using VapourSynth.

Simple metric usage with statistics. x264 and SVT-AV1 bindings.

Features

Quality metrics

  • CPU and/or GPU implementations depending on metric
    • SSIMULACRA2 (CPU, GPU)
    • XPSNR (CPU)
    • Butteraugli (GPU)
    • CVVDP (GPU)

Encoding

  • x264 and SVT-AV1 bindings
  • Common bindings for :
    • input/output
    • bitrate
    • crf
    • preset
    • tune
    • passes
    • encoder path
    • other (for parameters not implemented)
  • SVT-AV1 supports .vpy input script

Requirements

Examples

Quality metrics examples

from pathlib import Path

from pyvideotools import metrics

metric = metrics.VSzipSSIMULACRA2(
    source=Path("source.mkv"),
    distorted=Path("encoded.mkv"),
    skip=3,
)

metric.run()

print(metric.scores_standard_deviation)
print(metric.scores_median)

Encoding examples

SVT-AV1 CRF Encoding

from pyvideotools.encoders import AV1

cmd = AV1.SVTAV1CommandBuilder()
cmd.input("input.mkv")
cmd.preset("4")
cmd.crf(30)
cmd.output("output.mkv")
cmd.run()

SVT-AV1 VPY input with CRF encoding
VPY script taken from Auto-Boost-Essential by nekotrix

"""script.vpy"""
from vstools import vs, core, depth, DitherType
core.max_cache_size = 1024
src = core.ffms2.Source(source=r"input.mkv", cachefile=r"cache.ffindex")
bit_to_format = {
    8: vs.YUV420P8,
    10: vs.YUV420P10,
    12: vs.YUV420P12
}
bit_to_dither = {
    8: DitherType.NONE,
    10: DitherType.NONE,
    12: DitherType.RANDOM
}
fmt = bit_to_format.get(src.format.bits_per_sample, vs.YUV420P16)
dt = bit_to_dither.get(src.format.bits_per_sample, DitherType.RANDOM)
src = depth(src.resize.Bilinear(format=fmt), 10, dither_type=dt)
src.set_output()
"""main.py"""
from pyvideotools.encoders import AV1

cmd = AV1.SVTAV1CommandBuilder()
cmd.input("script.vpy", is_input_vpy=True)
cmd.preset("4")
cmd.crf(30)
cmd.output("output.mkv", overwrite=True)
cmd.run()

x264 2-pass target bitrate

from pyvideotools.encoders import H264

cmd = H264.x264CommandBuilder()
cmd.input("input.mp4")
cmd.preset("faster")
cmd.bitrate(682)
cmd.passes(2)
cmd.output("target.mkv", overwrite=True)
cmd.run()

Supported Implementations

Metric CPU GPU
SSIMULACRA2 VS-ZIP / Turbo-Metrics VSHIP
XPSNR VS-ZIP / FFmpeg -
Butteraugli - VSHIP
CVVDP - VSHIP

Metadata

Release files for pyvideotools 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvideotools 0.2.4
File Size Uploaded
pyvideotools-0.2.4.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvideotools 0.2.4
File Interpreter ABI Platform
pyvideotools-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / pyvideotools-0.2.4.tar.gz

Download URL pyvideotools-0.2.4.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
58258cdeda341e121bd1e6385cdeb3fcaee967f1f5c66b0936e3c092da226d9f
BLAKE2b-256 checksum
How to use checksums
f4b2b62e4e3643af360f960ee6cdac31e70cf87d83a940e2c9f2e3dec4ec579d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / pyvideotools-0.2.4-py3-none-any.whl

Download URL pyvideotools-0.2.4-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09992820fcb419b742d185e726dc53b91e4b5691a80db8746fc03e9e9add45f0
BLAKE2b-256 checksum
How to use checksums
b2ace3957bbe9499ed5d939b1ad2159351c13bf45b6207554aba14c37fc5f074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page