clipwright-loudness
MCP tool for audio loudness normalization detection and OTIO timeline annotation generation.
Overview
Measures audio loudness and peak level using ffmpeg loudnorm / volumedetect filters,
writes loudness instructions (mode, target, measured) to timeline-level metadata["clipwright"]["loudness"].
Performs detection only (OTIO annotation); realization (ffmpeg filter application) is done once by clipwright-render
(design M3: separation of detection and application).
Normalization modes:
loudnorm(EBU R128 LUFS): Two-stage linear method. detect measures withloudnorm print_format=jsonand savesmeasured_*parameters to OTIO annotation; render applies exact one-pass withloudnorm:linear=true.peak(max dB match): Measures max_volume withvolumedetectand applies gain difference in render.
Initial render support:
trackscope only (single loudness normalization applied to entire timeline).per_clipscope (individual clip application) deferred until after compositing.
Prerequisites
- Python 3.11 or later
- ffmpeg / ffprobe must exist on PATH or full paths set in environment variables
CLIPWRIGHT_FFMPEG/CLIPWRIGHT_FFPROBE.
Add ffmpeg to PATH directly or specify via environment variables:
export CLIPWRIGHT_FFMPEG=/path/to/ffmpeg
export CLIPWRIGHT_FFPROBE=/path/to/ffprobe
MCP Tool
clipwright_detect_loudness
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
media |
string |
required | Input media file path (audio required) |
output |
string |
required | Output OTIO timeline path (.otio, same directory as media) |
options.mode |
"loudnorm" | "peak" |
"loudnorm" |
Normalization mode |
options.target_i |
float |
-14.0 |
loudnorm mode: target integrated loudness (LUFS, -70 to -5) |
options.target_tp |
float |
-1.0 |
loudnorm mode: target true peak (dBTP, -9 to 0) |
options.target_lra |
float |
11.0 |
loudnorm mode: target loudness range (LU, 1 to 50) |
options.target_peak_db |
float |
-1.0 |
peak mode: target peak level (dB, -60 to 0) |
timeline |
string | null |
null |
Existing OTIO timeline path (if specified, append to it) |
Dependencies
| Package | Purpose |
|---|---|
clipwright |
Shared types, envelope, errors, process.run |
mcp[cli] |
MCP server |
pydantic |
Parameter validation |
ffmpeg / ffprobe are invoked as separate processes (via PATH or environment variables) for license independence.
loudnorm Linear Two-Stage Method
- detect (this tool):
ffmpeg -i <media> -af loudnorm=I=-14:TP=-1:LRA=11:print_format=json -f null -gets measured_* parameters and saves them to OTIO annotation. - render (clipwright-render):
loudnorm=I=-14:TP=-1:LRA=11:measured_I=..:...:linear=trueexecutes only one-pass linear application with detected parameters (improved accuracy).
Installation and Startup
Within a uv workspace:
uv run --package clipwright-loudness clipwright-loudness
Or install directly:
uv add clipwright-loudness
clipwright-loudness
Metadata
Release files for clipwright-loudness 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clipwright_loudness-0.4.1.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clipwright_loudness-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.0 kB
Release files / clipwright_loudness-0.4.1.tar.gz
| Download URL | clipwright_loudness-0.4.1.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
769b151308911de29c1cff108ef5aeaa2d319571016b58e2ef4fd9db00b83f70
|
|
BLAKE2b-256 checksum How to use checksums |
8ed669149d3a94c03151b9752544f7a43da79101dbed04eb158f25a64c294f4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 25, 2026.
Transparency logRelease files / clipwright_loudness-0.4.1-py3-none-any.whl
| Download URL | clipwright_loudness-0.4.1-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9c875f09e0ef27aeb9a71ead426d575e84346a2d51b5541f7a4f876ccff4786
|
|
BLAKE2b-256 checksum How to use checksums |
c439c61c73e39160e5163525c4f366560685b17f1c7691fd2e5d5ec45c318de5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 25, 2026.
Transparency log