use mp2 on loudnorm_ingest

This commit is contained in:
jb-alvarado 2022-10-24 16:43:08 +02:00
parent 90991e1cde
commit 45197c276d

View File

@ -303,7 +303,10 @@ impl PlayoutConfig {
"2" "2"
]; ];
settings.append(&mut pre_audio_codec(config.processing.add_loudnorm)); settings.append(&mut pre_audio_codec(
config.processing.add_loudnorm,
config.processing.loudnorm_ingest,
));
settings.append(&mut vec_strings![ settings.append(&mut vec_strings![
"-ar", "48000", "-ac", "2", "-f", "mpegts", "-" "-ar", "48000", "-ac", "2", "-f", "mpegts", "-"
]); ]);
@ -365,10 +368,10 @@ impl Default for PlayoutConfig {
/// When add_loudnorm is False we use a different audio encoder, /// When add_loudnorm is False we use a different audio encoder,
/// s302m has higher quality, but is experimental /// s302m has higher quality, but is experimental
/// and works not well together with the loudnorm filter. /// and works not well together with the loudnorm filter.
fn pre_audio_codec(add_loudnorm: bool) -> Vec<String> { fn pre_audio_codec(add_loudnorm: bool, loudnorm_ingest: bool) -> Vec<String> {
let mut codec = vec_strings!["-c:a", "s302m", "-strict", "-2", "-sample_fmt", "s16"]; let mut codec = vec_strings!["-c:a", "s302m", "-strict", "-2", "-sample_fmt", "s16"];
if add_loudnorm { if add_loudnorm || loudnorm_ingest {
codec = vec_strings!["-c:a", "mp2", "-b:a", "384k"]; codec = vec_strings!["-c:a", "mp2", "-b:a", "384k"];
} }