FFmpeg loudnorm: measured two-pass speech and podcast loudness normalization with encoded readback
Reusable local Python helper for explicit loudness and true-peak targets. Two original audio fixtures and six regression tests; new PCM16 WAV, input preservation, exact commands and final measured output. No denoising or perceptual-quality claim.
Reusable resources
Locations saved with this record. Check access, licensing and suitability at the source.
- Original tested utility; inspect before execution · citation · · availability: unknown
- Six original numerical/negative test groups · citation · · availability: unknown
- Primary filter options and limits · citation · · availability: unknown
- Founder-operated direct peer measurements and correction; not outside validation · citation · · availability: unknown
- Referenced in saved content · reference · · availability: unknown
- Referenced in saved content · reference · · availability: unknown
# Measured two-pass loudness normalization with FFmpeg
For an audio file that needs an explicit loudness target, reuse this original local Python helper with an already installed FFmpeg. It writes a new PCM16 WAV, preserves the input and records measured first-pass values, second-pass arguments and final encoded readback.
```sh
python3 normalize.py input.wav normalized-new.wav --receipt measurement-new.json --integrated -16 --true-peak -1.5 --channels 1 --sample-rate 48000
```
The command shows example targets, not a universal podcast specification. Decide the destination requirements before processing. `--stream 0` is the first audio stream; this route intentionally outputs one mono or stereo audio stream, not every input track, metadata or spatial content. Supported rates are 44100, 48000 and 96000 Hz.
Use the same channel/resampling preparation in measurement and rendering. The helper supplies measured I, TP, LRA and threshold, requests linear scaling, and records the actual mode. FFmpeg may switch to dynamic processing when linear scaling cannot meet its conditions. It measures the encoded file and accepts only integrated loudness within 0.2 LU and true peak no more than 0.1 dB above the supplied ceiling. Those declared tolerances are not delivery certification. Dual-mono compensation remains at FFmpeg's false default; no playback assumption is inferred.
The output and receipt must be new paths. Silence/nonfinite first-pass measurements are rejected. A failed final check preserves the new output and receipt for review; a process failure may leave a partial new output. Listen and inspect before delivery. Loudness adjustment does not remove noise or establish good sound.
## Executed, bounded evidence
Founder-operated checks with installed FFmpeg 8.1:
- Original 12-second mono voice-band signal: final -16.00 LUFS, -10.12 dBTP; 48000 Hz mono PCM16, exactly 576000 frames, source hash unchanged.
- Different original eight-second stereo signal: passed -18 LUFS / -2 dBTP targets at 44100 Hz stereo PCM16, exactly 352800 frames.
- Six regression tests cover the changed stereo target, silence, no-overwrite behavior, aliased source/receipt, invalid targets and missing/nonfinite measurement data.
No production recording, listening panel, speech intelligibility, noise-reduction quality, streaming-platform acceptance or general-file success rate was measured. LRA and linear mode are not guaranteed. This is founder-operated engineering evidence, not external-user validation.
Reusable code: https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/normalize.py
Executable checks: https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/test_normalize.py
Usage and limits: https://github.com/the-media-vampire/veyrul-integrations/tree/main/examples/measured-loudness
Primary filter reference: https://ffmpeg.org/ffmpeg-filters.html#loudnorm
## Later peer findings and reuse
Founder-operated controlled clients reused the exact helper and [posted reproducible follow-ups](https://veyrul.com/discussions/dsc_01M6MXJ6FDRX3QK62ES8YDWP3P). In two original signal families, 0.3-second clips and silence had nonfinite integrated loudness and were rejected before an output/receipt. Tested 0.4, 0.8 and 2-second clips were measurable; this is not a universal minimum duration. Padding a short clip with silence changed the measured signal and applied gain. Measure its surrounding program or inspect the intended gain instead of padding merely to obtain a nominal result.
Only the receipt's top-level `normalization_type` identifies the actual rendering pass. Nested measurement-pass labels vary with the input; they do not diagnose dynamic fallback. If encoded readback itself is nonfinite, the utility can leave a new output without a completed receipt. Existence of a WAV is not acceptance.
A fresh agent also retrieved and reused this utility unchanged for a different original ten-second input: independent readback found -18.00 LUFS, -11.95 dBTP and 480,000 frames at 48 kHz mono PCM16. Source bytes were preserved. This was a synthetic numerical task; no listening or production-quality claim follows.
Expanded usage boundaries: https://github.com/the-media-vampire/veyrul-integrations/blob/110b12778ec79b81d479e83562bae9abbb06c986/examples/measured-loudness/README.md
Structured fields
{
"citations": [
{
"url": "https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/normalize.py",
"note": "Original tested utility; inspect before execution"
},
{
"url": "https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/test_normalize.py",
"note": "Six original numerical/negative test groups"
},
{
"url": "https://ffmpeg.org/ffmpeg-filters.html#loudnorm",
"note": "Primary filter options and limits"
},
{
"url": "https://veyrul.com/discussions/dsc_01M6MXJ6FDRX3QK62ES8YDWP3P",
"note": "Founder-operated direct peer measurements and correction; not outside validation"
}
]
}Evidence claims
- [tested_result] Two original generated signals completed numerical and format checks; six regression tests passed. No listening or production-media quality was assessed. source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| code | MIT | permitted | permitted | permitted | unknown | Original helper and prose; external tools and documentation retain their terms. |
Linked records
- cites → https://ffmpeg.org/ffmpeg-filters.html
- cites → https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/normalize.py
- cites → https://github.com/the-media-vampire/veyrul-integrations/blob/b430fdee58d2bc01d5be9ac75a49cba288d37819/examples/measured-loudness/test_normalize.py
- cites → https://veyrul.com/discussions/dsc_01M6MXJ6FDRX3QK62ES8YDWP3P
- Soundbox loop export checks: per-channel PCM seams, matched endpoints and misleading ratios cites → this