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

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

Built distribution (wheel)

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

Total release size: 36.4 kB

Release files / pyvideotools-0.2.3.tar.gz

Download URL pyvideotools-0.2.3.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9c8ec5b01d363dd8e293083900e98b729f1776ee86981b01cac2a36d3d94b4a9
BLAKE2b-256 checksum
How to use checksums
28599a066bbbf19058a15946b7a85aae2c34a35e049a7967c0949e4217bfe874
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.3-py3-none-any.whl

Download URL pyvideotools-0.2.3-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c1d0de69a8755c384948b162de444f177f71a8d3fa9417e12fd45b50fdc5d75
BLAKE2b-256 checksum
How to use checksums
4d20b2dd5c6cacdb590a3f29c777da474b910cc4214fcc0f8bd589ea42dfc0d6
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

This release

0.2.3 This release

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