add at least anull filter

This commit is contained in:
jb-alvarado 2022-10-02 13:28:45 +02:00
parent 5111ec1dd1
commit dcc4616421
3 changed files with 19 additions and 14 deletions

View File

@ -90,6 +90,7 @@ fn fake_time(args: &Args) {
fn main() { fn main() {
let args = get_args(); let args = get_args();
// use fake time function only in debugging mode
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
fake_time(&args); fake_time(&args);

View File

@ -364,6 +364,10 @@ pub fn filter_chains(
overlay(node, &mut filters, config); overlay(node, &mut filters, config);
realtime_filter(node, &mut filters, config); realtime_filter(node, &mut filters, config);
// add at least anull filter, for correct filter construction,
// is important for split filter in HLS mode
filters.add_filter("anull", Audio);
add_loudnorm(&mut filters, config); add_loudnorm(&mut filters, config);
fade(node, &mut filters, Audio); fade(node, &mut filters, Audio);
audio_volume(&mut filters, config); audio_volume(&mut filters, config);

View File

@ -11,7 +11,7 @@ use simplelog::*;
use crate::utils::{ use crate::utils::{
format_log_line, loop_image, sec_to_time, seek_and_length, valid_source, vec_strings, format_log_line, loop_image, sec_to_time, seek_and_length, valid_source, vec_strings,
JsonPlaylist, Media, PlayoutConfig, IMAGE_FORMAT, JsonPlaylist, Media, PlayoutConfig, FFMPEG_IGNORE_ERRORS, IMAGE_FORMAT,
}; };
/// check if ffmpeg can read the file and apply filter to it. /// check if ffmpeg can read the file and apply filter to it.
@ -58,9 +58,7 @@ fn check_media(
let mut filter = node.filter.unwrap_or_default(); let mut filter = node.filter.unwrap_or_default();
if filter.len() > 1 { if filter.len() > 1 {
filter[1] = filter[1] filter[1] = filter[1].replace("realtime=speed=1", "null")
.replace("realtime=speed=1", "null")
.replace("arealtime=speed=1", "snull")
} }
enc_cmd.append(&mut node.cmd.unwrap_or_default()); enc_cmd.append(&mut node.cmd.unwrap_or_default());
@ -81,24 +79,26 @@ fn check_media(
for line in enc_err.lines() { for line in enc_err.lines() {
let line = line?; let line = line?;
if line.contains("[error]") { if !FFMPEG_IGNORE_ERRORS.iter().any(|i| line.contains(*i)) {
let log_line = format_log_line(line, "error"); if line.contains("[error]") {
let log_line = format_log_line(line, "error");
if !error_list.contains(&log_line) { if !error_list.contains(&log_line) {
error_list.push(log_line); error_list.push(log_line);
} }
} else if line.contains("[fatal]") { } else if line.contains("[fatal]") {
let log_line = format_log_line(line, "fatal"); let log_line = format_log_line(line, "fatal");
if !error_list.contains(&log_line) { if !error_list.contains(&log_line) {
error_list.push(log_line); error_list.push(log_line);
}
} }
} }
} }
if !error_list.is_empty() { if !error_list.is_empty() {
error!( error!(
"<bright black>[Validator]</> Compressing error on position <yellow>{pos}</> {}: <b><magenta>{}</></b>:\n{}", "<bright black>[Validator]</> ffmpeg error on position <yellow>{pos}</> - {}: <b><magenta>{}</></b>:\n{}",
sec_to_time(begin), sec_to_time(begin),
node.source, node.source,
error_list.join("\n") error_list.join("\n")