Skip to main content

Fast native H.264 QP and macroblock map extractor using FFmpeg

Project description

QPMBDeblock

Native H.264 QP and macroblock map extractor. Uses FFmpeg's AV_FRAME_DATA_VIDEO_ENC_PARAMS side-data to extract per-macroblock QP values from H.264 streams without log parsing.

Installation

pip install QPMBDeblock

Runtime requirement: FFmpeg must be installed and available in PATH.

Python API

from qpmbdeblock import h264QPparser

parser = h264QPparser("video.mkv")

# Extract + write in one step. Returns output path or None on failure.
result = parser.create_qp_map("output.qpmap.mkv")

# Or separately:
qpmap = parser.extract()           # numpy.ndarray (n_frames, mb_rows, mb_cols), dtype int8
parser.write_video(qpmap, "output.qpmap.mkv")

extract() returns a 3-D int8 NumPy array with QP values in [0, 63].

VapourSynth

from qpmbdeblock import VSqpmap_mask

# Generates output.qpmap.mkv on first call, loads it on subsequent calls.
qp = VSqpmap_mask(
    "video.mkv",
    reference_clip=src,   # required when scale_video=True (default)
    high_bitdepth=True,   # GRAY16, values 0–63
)
Parameter Default Description
qpmap_path <video>.qpmap.mkv Custom path for the QP map MKV
ffmpeg_path "ffmpeg" Path to ffmpeg executable
scale_video True Upscale 16× and crop to reference_clip dimensions
high_bitdepth True Output GRAY16 instead of GRAY8

Source plugin priority: bestsource → ffms2 → lsmas

Build from source

Requirements: CMake ≥ 3.15, C++17 compiler, FFmpeg dev headers, pybind11.

# Set FFmpeg location (Windows only, if not using pkg-config)
$env:FFMPEG_ROOT = "C:\path\to\ffmpeg-full_build-shared"

pip install .

On Linux/macOS with system FFmpeg:

apt install libavcodec-dev libavformat-dev libavutil-dev  # Debian/Ubuntu
pip install .

Output format

Lossless grayscale FFV1 MKV. Each pixel maps 1:1 to one macroblock. Pixel value = QP value (0–63). FPS matches the source video.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

qpmbdeblock-0.2.0-cp313-cp313-win_amd64.whl (81.4 kB view details)

Uploaded CPython 3.13Windows x86-64

qpmbdeblock-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

qpmbdeblock-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

qpmbdeblock-0.2.0-cp312-cp312-win_amd64.whl (81.4 kB view details)

Uploaded CPython 3.12Windows x86-64

qpmbdeblock-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

qpmbdeblock-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

Details for the file qpmbdeblock-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4dc7358d76b5056d8326fbb02fb9007283871058092dc835d72ff09cc1316ff0
MD5 2ad6086d16be2e8f9e07814f71f6ec02
BLAKE2b-256 516db09863ec57162acf1bc46d22c0e6e1f89e8b6600d267ad18a53e18816127

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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

File details

Details for the file qpmbdeblock-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5ff3fa21b60e54f586b3219f3063c8dbcd28bf188ff973ec37840c2faea1e649
MD5 5c889678c6b2e04a19d69cad4d24412b
BLAKE2b-256 a71eb46f7b9aad5cad53ba5c77c148b85d77d22fcce4f79fb0c44e647700ac0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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

File details

Details for the file qpmbdeblock-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d56d6dfc72830f1dcfb9364cb0f141e38cff24ca92811b8d6d4aae3517fa212a
MD5 a223587e5b7f7ec7fed98863b5b3261a
BLAKE2b-256 010c7b22dcdf34937d0e3cfeb65ccde54cab1f328713ea3703e98f890c082e4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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

File details

Details for the file qpmbdeblock-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5ab77481cffb6ff8dd6484c7c07f0da6dfa1af77a8699499b567a9fb66911b92
MD5 e7a07fb4a85a1686542f14c5e53bb7e4
BLAKE2b-256 6a8d1781f995ccda26344de385081ad5ce71187a433160c2fa2fbc1acae0e7f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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

File details

Details for the file qpmbdeblock-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d69132eacb88edd92b7c703feabe842c72adc565533f686697420f4383ced143
MD5 00a8de05e2a9dd73b5b3e0c59f561009
BLAKE2b-256 ded9299dab2adf99166ea7c6e9b607fb9c07ca286e7db51a4d504d0ea75f66e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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

File details

Details for the file qpmbdeblock-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for qpmbdeblock-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 915ac2995bd1685f42d008bf4d3c4989c6b2ba8c78eeac150ea12d78e5a8c5f6
MD5 2ac4b0be41cd9238f11935750cc16251
BLAKE2b-256 e074927acb68a7ff67b5fc9725b40aca88f3d8267e85fc64f1936d2574d6695f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qpmbdeblock-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_wheels.yml on PingWer/QPMBDeblock

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