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.2

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.2
File Size Uploaded
pyvideotools-0.2.2.tar.gz 25.0 kB Details

Built distribution (wheel)

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

Total release size: 36.4 kB

Release files / pyvideotools-0.2.2.tar.gz

Download URL pyvideotools-0.2.2.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
189a08485a6e0057041115fca33838d01d7c4bade0a0321c9587bccaa966454b
BLAKE2b-256 checksum
How to use checksums
9c9efda54ac9580b4f6e32e5b81e2a3564d3743ac835e25710319f675290e3d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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 Sep 27, 2026.

Transparency log

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

Download URL pyvideotools-0.2.2-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8775ea7d9146a74a3968813b927ef3096c1e6827f94f71bffbabf1df3c5f2816
BLAKE2b-256 checksum
How to use checksums
dd78c8d6074d90b8b784984ceb3b0375573eee8857cf602afb4849489c3b7da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.4

2 release files

0.2.3

2 release files

This release

0.2.2 This release

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