filter-chain: add ebur128 filter

The EBU R128 filter measures the signal and generates LUFS control
notifications for further processing.

It also adds a plugin that can convert LUFS to a gain (based on a target
LUFS).

Also add an example filter-chain to enable the EBU R128 measurement and
how to use the results to adjust the volume dynamically.

See #2286 #222 #2210
This commit is contained in:
Wim Taymans 2024-12-09 11:12:35 +01:00
parent f0f9fbb009
commit df271d13f3
6 changed files with 792 additions and 3 deletions

View file

@ -0,0 +1,63 @@
context.modules = [
{ name = libpipewire-module-filter-chain
args = {
node.description = "EBU R128 Normalizer"
media.name = "EBU R128 Normalizer"
filter.graph = {
nodes = [
{
name = ebur128
type = ebur128
label = ebur128
}
{
name = lufsL
type = ebur128
label = lufs2gain
control = {
"Target LUFS" = -16.0
}
}
{
name = lufsR
type = ebur128
label = lufs2gain
control = {
"Target LUFS" = -16.0
}
}
{
name = volumeL
type = builtin
label = linear
}
{
name = volumeR
type = builtin
label = linear
}
]
links = [
{ output = "ebur128:Out FL" input = "volumeL:In" }
{ output = "ebur128:Global LUFS" input = "lufsL:LUFS" }
{ output = "lufsL:Gain" input = "volumeL:Mult" }
{ output = "ebur128:Out FR" input = "volumeR:In" }
{ output = "ebur128:Global LUFS" input = "lufsR:LUFS" }
{ output = "lufsR:Gain" input = "volumeR:Mult" }
]
inputs = [ "ebur128:In FL" "ebur128:In FR" ]
outputs = [ "volumeL:Out" "volumeR:Out" ]
}
capture.props = {
node.name = "effect_input.ebur128_normalize"
audio.position = [ FL FR ]
media.class = Audio/Sink
}
playback.props = {
node.name = "effect_output.ebur128_normalize"
audio.position = [ FL FR ]
node.passive = true
}
}
}
]