#!/usr/bin/env bash # loudness: prints a film's integrated loudness (LUFS) and true peak, measured by ffmpeg (EBU R128). # From AI & Things (https://aiandthings-film-method.vercel.app). # # checks/loudness.sh film.mp4 # # Aim for about -16 LUFS for the web and -14 LUFS for Reels and TikTok, with the true peak under -1.5 dBTP. # To set it: ffmpeg -i in.mp4 -c:v copy -af "loudnorm=I=-16:TP=-1.5:LRA=11" -c:a aac -b:a 256k out.mp4 set -euo pipefail [ $# -eq 1 ] || { echo "usage: loudness.sh "; exit 64; } ffmpeg -nostats -i "$1" -af ebur128=peak=true -f null - 2>&1 | awk '/Summary:/{s=1} s && /I:|Peak:/{print}'