Skip to main content

RGB packing for VapourSynth frames

Project description

VSPackRGB

RGB packing for VapourSynth frames.

Converts planar RGB VapourSynth clips into display-ready packed formats:

  • RGB24 → BGRA (8-bit interleaved, stored in GRAY32)
  • RGB30 → A2R10G10B10 (10-bit packed, stored in GRAY32)
  • RGB48 → RGBA64 (16-bit interleaved, stored in GRAY16)
  • RGBH → RGBA16F (16-bit float interleaved, stored in GRAYH)
  • RGBS → RGBA32F (32-bit float interleaved, stored in GRAYS)

For higher-than-10-bit formats, the output clip is 4x wider than the input to accommodate the interleaved R, G, B, and A channels.

Installation

Prebuilt wheels are provided for most platforms. If a compatible wheel is available, no compilation is required.

pip install vspackrgb

With uv:

uv add vspackrgb

Benchmarks

  • CPU 9800X3D Windows 11 Pro 25H2 (26200.8655)
  • Python 3.12.13
  • VapourSynth R77 (With unlimited max_cache_size)
  • vszip 15.0.0
  • libp2p R2 (+ RGB48 packing fix)
  • akarin 1.4.1
  • cython 3.2.5
  • numpy 2.4.6
  • numba 0.65.1

Blank clip with keep=True

             RGB24 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃     FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
│ vszip.PackRGB      │  20000 │  5.895s │ 3392.88 │
│ libp2p.Pack        │  20000 │  5.971s │ 3349.38 │
│ akarin.Expr        │  20000 │  5.951s │ 3360.97 │
│ vspackrgb (cython) │   7000 │  6.370s │ 1098.85 │
│ vspackrgb (numba)  │   7000 │  2.903s │ 2411.60 │
│ vspackrgb (numpy)  │   2000 │  5.754s │  347.57 │
│ vspackrgb (python) │     25 │ 10.029s │    2.49 │
└────────────────────┴────────┴─────────┴─────────┘

            RGB30 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃ Backend            ┃ Frames ┃   Time ┃     FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ vszip.PackRGB      │  20000 │ 5.865s │ 3410.05 │
│ libp2p.Pack        │  20000 │ 5.903s │ 3388.30 │
│ akarin.Expr        │  20000 │ 5.911s │ 3383.56 │
│ vspackrgb (cython) │   7000 │ 7.801s │  897.35 │
│ vspackrgb (numba)  │   7000 │ 2.925s │ 2393.24 │
│ vspackrgb (numpy)  │   2000 │ 8.973s │  222.88 │
│ vspackrgb (python) │     25 │ 7.251s │    3.45 │
└────────────────────┴────────┴────────┴─────────┘

             RGB48 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃     FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
│ libp2p.Pack        │  20000 │ 12.004s │ 1666.09 │
│ vspackrgb (cython) │   7000 │  7.540s │  928.41 │
│ vspackrgb (numba)  │   7000 │  5.416s │ 1292.48 │
│ vspackrgb (numpy)  │   2000 │  8.061s │  248.12 │
│ vspackrgb (python) │     25 │  9.996s │    2.50 │
└────────────────────┴────────┴─────────┴─────────┘

             RGBH Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃ Backend            ┃ Frames ┃   Time ┃     FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ vspackrgb (cython) │   7000 │ 7.513s │  931.70 │
│ vspackrgb (numba)  │   7000 │ 5.392s │ 1298.17 │
│ vspackrgb (numpy)  │   2000 │ 8.116s │  246.42 │
│ vspackrgb (python) │     25 │ 9.979s │    2.51 │
└────────────────────┴────────┴────────┴─────────┘

             RGBS Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ vspackrgb (cython) │   7000 │ 13.385s │ 522.98 │
│ vspackrgb (numba)  │   7000 │ 10.433s │ 670.92 │
│ vspackrgb (numpy)  │   2000 │ 13.386s │ 149.41 │
│ vspackrgb (python) │     25 │  9.890s │   2.53 │
└────────────────────┴────────┴─────────┴────────┘

Real world scenario

Source clip is a 1080p .m2ts file muxed to .mkv, indexed with BestSource R18 and resampled to the target format with resize.Point

            RGB24 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ vszip.PackRGB      │   7000 │  9.451s │ 740.69 │
│ libp2p.Pack        │   7000 │  9.402s │ 744.52 │
│ akarin.Expr        │   7000 │  9.572s │ 731.30 │
│ vspackrgb (cython) │   7000 │ 10.504s │ 666.43 │
│ vspackrgb (numba)  │   7000 │  9.586s │ 730.22 │
│ vspackrgb (numpy)  │   2000 │  6.862s │ 291.46 │
│ vspackrgb (python) │     25 │ 10.065s │   2.48 │
└────────────────────┴────────┴─────────┴────────┘

            RGB30 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ vszip.PackRGB      │   7000 │ 10.170s │ 688.27 │
│ libp2p.Pack        │   7000 │ 10.321s │ 678.25 │
│ akarin.Expr        │   7000 │ 10.471s │ 668.54 │
│ vspackrgb (cython) │   7000 │ 13.434s │ 521.06 │
│ vspackrgb (numba)  │   7000 │ 10.394s │ 673.43 │
│ vspackrgb (numpy)  │   2000 │ 10.672s │ 187.41 │
│ vspackrgb (python) │     25 │  7.350s │   3.40 │
└────────────────────┴────────┴─────────┴────────┘

            RGB48 Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ libp2p.Pack        │   7000 │ 11.665s │ 600.06 │
│ vspackrgb (cython) │   7000 │ 13.496s │ 518.69 │
│ vspackrgb (numba)  │   7000 │ 12.391s │ 564.91 │
│ vspackrgb (numpy)  │   2000 │  9.071s │ 220.48 │
│ vspackrgb (python) │     25 │ 10.061s │   2.48 │
└────────────────────┴────────┴─────────┴────────┘

             RGBH Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ vspackrgb (cython) │   7000 │ 13.244s │ 528.53 │
│ vspackrgb (numba)  │   7000 │ 12.213s │ 573.18 │
│ vspackrgb (numpy)  │   2000 │  8.805s │ 227.14 │
│ vspackrgb (python) │     25 │ 10.002s │   2.50 │
└────────────────────┴────────┴─────────┴────────┘

             RGBS Packing (1920x1080)
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
┃ Backend            ┃ Frames ┃    Time ┃    FPS ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
│ vspackrgb (cython) │   7000 │ 22.907s │ 305.58 │
│ vspackrgb (numba)  │   7000 │ 20.397s │ 343.19 │
│ vspackrgb (numpy)  │   2000 │ 17.765s │ 112.58 │
│ vspackrgb (python) │     25 │  9.974s │   2.51 │
└────────────────────┴────────┴─────────┴────────┘

Building

You only need a working C compiler/toolchain for your platform:

  • Windows: Visual Studio Build Tools (Desktop development with C++)
  • Linux: GCC/Clang and Python headers
  • macOS: Xcode Command Line Tools
uv build --sdist --wheel --verbose

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vspackrgb-1.3.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vspackrgb-1.3.0-cp312-abi3-win_amd64.whl (73.7 kB view details)

Uploaded CPython 3.12+Windows x86-64

vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_x86_64.whl (451.3 kB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ x86-64

vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_aarch64.whl (437.1 kB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

vspackrgb-1.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (453.3 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

vspackrgb-1.3.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (447.2 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

vspackrgb-1.3.0-cp312-abi3-macosx_13_0_x86_64.whl (88.7 kB view details)

Uploaded CPython 3.12+macOS 13.0+ x86-64

vspackrgb-1.3.0-cp312-abi3-macosx_13_0_arm64.whl (85.5 kB view details)

Uploaded CPython 3.12+macOS 13.0+ ARM64

File details

Details for the file vspackrgb-1.3.0.tar.gz.

File metadata

  • Download URL: vspackrgb-1.3.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vspackrgb-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3bb02182be246fc845f08a3ab8d696a13e4f9c20dbd9622b1351eb400dee90b4
MD5 5fc027a88bd63190bc30bb6a472a16bc
BLAKE2b-256 8f8e7e936e57640b81da299198266285fa54f1e8f86ff08539d472e626c0b9a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0.tar.gz:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: vspackrgb-1.3.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 73.7 kB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b4496125d3f493918194e83d2dc96634333a40e9147e4f4427de8f5d193f782f
MD5 9b21874e4738d2e0c9cbf952b9da92b8
BLAKE2b-256 56c3cd8492cccd34d9eb0d63fd4a334672d6b2df5fbac1b325135b1e17fc743a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-win_amd64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a8c9e6d41be67787a05450d844af031012a7c3c82b6e3cf0c7e7d727ca6c43aa
MD5 da0facb3753c5e1f0ce2e7b0168245d0
BLAKE2b-256 b0ad1d1e1dddaf815b039600399da7de875efd113580b7153f8711ff930f3d2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_x86_64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 89e2f19d347dabfc251f31d2be0f1e9603052ccd7d2e28b56ab5850af90ee402
MD5 f57fb8aad4b0c1dcd76b7cc4b5b03169
BLAKE2b-256 c3e843105de2c20f4b90919c3280617fb7697bd46e3118d86bd1c6765a3d8093

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-musllinux_1_2_aarch64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 42f161d4933d87d7f5cc78bf2b2d4df3d2f22161547b8adf1c4621824a028e93
MD5 5127134d5891f8fefa82bc415893f0c6
BLAKE2b-256 913db520cf2ad66b6f8a7249d6cadede2036502e7879b67575ec49c44a013d30

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5ace4abaea3a957a108290691b80ef46d2c2948cacd2597e367ec54dee07caac
MD5 a775d51eb00297203e7692ce0875b22a
BLAKE2b-256 6dcc859d554d1fe9b78e0d82cb0f84a7ad1b24bc9de95b681b65d315a4b5ab51

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d3fad6d1e75641bf4d124aab4d4e20adec9037498603345696a7a27093b9b79e
MD5 f3b5aee9dd02f8baac5444890ab058e9
BLAKE2b-256 336706fbf18ddb8ba46b4ef5a66827b28606dbe7218e593fb814fde26278f09e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-macosx_13_0_x86_64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vspackrgb-1.3.0-cp312-abi3-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.3.0-cp312-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 8b03b36901cf5873ec28ee354be94c5036f9c63d389553ff17f6b02bb5c09d1d
MD5 bd1b5d74b8d434ee9425d26f7adfd7a3
BLAKE2b-256 4e66e122dacdc4e0a17685331ab4dfd900099e7e9c12752229947d821e3abe0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.3.0-cp312-abi3-macosx_13_0_arm64.whl:

Publisher: pypipublish.yml on Jaded-Encoding-Thaumaturgy/vs-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page