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.4.0.tar.gz (13.0 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.4.0-cp312-abi3-win_amd64.whl (74.4 kB view details)

Uploaded CPython 3.12+Windows x86-64

vspackrgb-1.4.0-cp312-abi3-musllinux_1_2_x86_64.whl (455.2 kB view details)

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

vspackrgb-1.4.0-cp312-abi3-musllinux_1_2_aarch64.whl (441.3 kB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

vspackrgb-1.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (456.7 kB view details)

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

vspackrgb-1.4.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (451.2 kB view details)

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

vspackrgb-1.4.0-cp312-abi3-macosx_13_0_x86_64.whl (89.4 kB view details)

Uploaded CPython 3.12+macOS 13.0+ x86-64

vspackrgb-1.4.0-cp312-abi3-macosx_13_0_arm64.whl (84.0 kB view details)

Uploaded CPython 3.12+macOS 13.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for vspackrgb-1.4.0.tar.gz
Algorithm Hash digest
SHA256 6f3a227e70c09d9dbc35c5f2500b0d23c7729de8197886c8e511d372d385a5b4
MD5 9f920b67af170d68510d6258344b6a9d
BLAKE2b-256 f47fd487740b694d6e99522301bf594b80492730be77c5ea2902ff528d93122b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: vspackrgb-1.4.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 74.4 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.4.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c21c56b1bae6eaae5b450a5e003e1e5af62f432b2e33ae66f7ef5916750db630
MD5 75db5f9d07708297258d37f9e96d1864
BLAKE2b-256 ad8f790546cecf4293d43d5c12ebc0cd440f3e02005ccd5fa3f9421c5a516b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.4.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2bb44eb256fa66beeddd11b9e5761b8c891c014545d210f11061b529e5ccfd00
MD5 45057c17acdf2cf57673eab749b42b39
BLAKE2b-256 598d55844a8e4afbd958e9eea3142c07c1779024ee2b227ea14f309ba655d064

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.4.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6d81b8b3b16a90fc06adb9e88e4d62d2bfe754875c73279ac243d5cc6d6d1dc6
MD5 bec7fb08c990f91387b392f6f32599ba
BLAKE2b-256 f24d563ec08fa2cd409e1471857e5a7f1f06fef0e3dfaad58db1d2a421c4f41d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.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.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 918cfb8234c72e736cc47e28f9bf888bb0360b40a8c53138824233453088641a
MD5 52d423f68a1e933c41c95ab16fbacf2b
BLAKE2b-256 cc6c3c0509df886c467a7186e84d39d73c847f8db05e4b5e72efc1010f0e155c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.4.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1d3f2f19e846b26006493f642568e4d6dd398e381e338afc7b5b4967ebc6f8d4
MD5 74abf5a4b4913eaa40e1a52a4f0ed072
BLAKE2b-256 4b90f1ed1cd4251480fa134d962399b084ca820f8ee698a496a8d063fcbcb510

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.4.0-cp312-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 bb051e3a7a1ef7cee3c297b6bb9e2192c347ef53f9ebe161361f08c394f4f61f
MD5 1c12821aad9201498fa55d4ce0d7b3f7
BLAKE2b-256 b59053618f5a2b8bb31ab29828504ff7a4b28abeeb6ab62372249cff1115bd46

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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.4.0-cp312-abi3-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for vspackrgb-1.4.0-cp312-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b0a71fdd540bca353a88349a8ea49ead34291f6dfc1ab72e1ca9074a1d2535af
MD5 bf758ee06f598a8d64c354956a366c83
BLAKE2b-256 6a5433fb31b2aebed5a69cc10f1db44fc77312c64442d5675fcfa28623ed5306

See more details on using hashes here.

Provenance

The following attestation bundles were made for vspackrgb-1.4.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