Skip to content

Commit

Permalink
remove loudnorm filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jb-alvarado committed Apr 10, 2023
1 parent 676d71e commit 535511f
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 82 deletions.
71 changes: 36 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["ffplayout-api", "ffplayout-engine", "lib", "tests"]
default-members = ["ffplayout-api", "ffplayout-engine", "tests"]

[workspace.package]
version = "0.17.2"
version = "0.18.0"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Check the [releases](https://github.com/ffplayout/ffplayout/releases/latest) for
- send emails with error message
- overlay a logo
- overlay text, controllable through [ffplayout-frontend](https://github.com/ffplayout/ffplayout-frontend) (needs ffmpeg with libzmq and enabled JSON RPC server)
- EBU R128 loudness normalization (will be removed in future)
- loop playlist infinitely
- [remote source](/docs/remote_source.md)
- trim and fade the last clip, to get full 24 hours
Expand Down
17 changes: 6 additions & 11 deletions assets/ffplayout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ processing:
scaling. With 'logo_opacity' logo can become transparent. With 'audio_tracks' it
is possible to configure how many audio tracks should be processed. 'audio_channels'
can be use, if audio has more channels then only stereo. With 'logo_filter'
'overlay=W-w-12:12' you can modify the logo position. With 'use_loudnorm'
you can activate single pass EBU R128 loudness normalization, 'loudnorm_ingest'
allows normalization only on ingest stream. 'loud_*' can adjust the loudnorm filter.
With 'custom_filter' it is possible, to apply further filters. The filter outputs
should end with [c_v_out] for video filter, and [c_a_out] for audio filter.
'overlay=W-w-12:12' you can modify the logo position. With 'custom_filter'
it is possible, to apply further filters. The filter outputs should end with
[c_v_out] for video filter, and [c_a_out] for audio filter.
mode: playlist
audio_only: false
width: 1024
Expand All @@ -69,20 +67,17 @@ processing:
logo_filter: overlay=W-w-12:12
audio_tracks: 1
audio_channels: 2
add_loudnorm: false
loudnorm_ingest: false
loud_i: -18
loud_tp: -1.5
loud_lra: 11
volume: 1
custom_filter:

ingest:
help_text: Run a server for a ingest stream. This stream will override the normal streaming
until is done. There is only a very simple authentication mechanism, which check if the
stream name is correct.
stream name is correct. 'custom_filter' can be used in the same way then the one in the
process section.
enable: false
input_param: -f live_flv -listen 1 -i rtmp://127.0.0.1:1936/live/stream
custom_filter:

playlist:
help_text: >
Expand Down
6 changes: 6 additions & 0 deletions docs/custom_filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ It is possible to apply only video or audio filters, or both. For a better under
custom_filter: "gblur=5[c_v_out];volume=0.5[c_a_out]"
```

#### Apply loudnorm filter:

```YAML
custom_filter: "loudnorm=I=-18:TP=-1.5:LRA=11[c_a_out]"
```

#### Add lower third:

```YAML
Expand Down
2 changes: 1 addition & 1 deletion ffplayout-frontend
11 changes: 0 additions & 11 deletions lib/src/filter/a_loudnorm.rs

This file was deleted.

18 changes: 6 additions & 12 deletions lib/src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{
use regex::Regex;
use simplelog::*;

mod a_loudnorm;
mod custom;
pub mod v_drawtext;

Expand Down Expand Up @@ -390,15 +389,6 @@ fn extend_audio(node: &mut Media, chain: &mut Filters, nr: i32) {
}
}

/// Add single pass loudnorm filter to audio line.
fn add_loudnorm(node: &Media, chain: &mut Filters, config: &PlayoutConfig, nr: i32) {
if config.processing.add_loudnorm || (node.unit == Ingest && config.processing.loudnorm_ingest)
{
let loud_filter = a_loudnorm::filter_node(config);
chain.add_filter(&loud_filter, nr, Audio);
}
}

fn audio_volume(chain: &mut Filters, config: &PlayoutConfig, nr: i32) {
if config.processing.volume != 1.0 {
chain.add_filter(&format!("volume={}", config.processing.volume), nr, Audio)
Expand Down Expand Up @@ -568,7 +558,12 @@ pub fn filter_chains(
realtime(node, &mut filters, config, Video);
}

let (proc_vf, proc_af) = custom::filter_node(&config.processing.custom_filter);
let (proc_vf, proc_af) = if node.unit == Ingest {
custom::filter_node(&config.ingest.custom_filter)
} else {
custom::filter_node(&config.processing.custom_filter)
};

let (list_vf, list_af) = custom::filter_node(&node.custom_filter);

if config.processing.audio_only {
Expand Down Expand Up @@ -599,7 +594,6 @@ pub fn filter_chains(
// is important for split filter in HLS mode
filters.add_filter("anull", i, Audio);

add_loudnorm(node, &mut filters, config, i);
fade(node, &mut filters, i, Audio);
audio_volume(&mut filters, config, i);

Expand Down

0 comments on commit 535511f

Please sign in to comment.