From 6fae130b4e25b5b21cfc0e5558c57e8f7eeb9e20 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Wed, 31 Aug 2022 09:49:49 +0200 Subject: [PATCH] add doc for custom filter, catch fatal error: Numerical result * --- docs/README.md | 4 ++++ docs/custom_filters.md | 29 +++++++++++++++++++++++++++++ lib/src/utils/mod.rs | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 docs/custom_filters.md diff --git a/docs/README.md b/docs/README.md index cb0af15a..d8eb1d01 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,6 +21,10 @@ Using live ingest to inject a live stream. The different output modes. +### **[Custom Filter](/docs/custom_filters.md)** + +Apply self defined audio/video filters. + ### **[Preview Stream](/docs/preview_stream.md)** Setup and use a preview stream. diff --git a/docs/custom_filters.md b/docs/custom_filters.md new file mode 100644 index 00000000..a8f717f2 --- /dev/null +++ b/docs/custom_filters.md @@ -0,0 +1,29 @@ +## Custom filter + +ffplayout allows it to define a custom filter string. For that is the parameter **custom_filter** in the ffplayout.yml config file. +The filter outputs should end with `[c_v_out]` for video filter, and `[c_a_out]` for audio filter. The filters will be apply on every clip and after the filters which unify the clips. + +It is possible to apply only video or audio filters, or both. For a better understanding here some examples: + +#### Apply Gaussian blur and volume filter: + +```YAML +custom_filter: 'gblur=5[c_v_out];volume=0.5[c_a_out]' +``` + +#### Add lower third: + +```YAML +custom_filter: '[v_in];movie=/path/to/lower_third.png:loop=0,scale=1024:576,setpts=N/(25*TB)[lower];[v_in][lower]overlay=0:0:shortest=1[c_v_out]' +``` + +Pay attention to the filter prefix `[v_in];`, this is necessary to get the output from the regular filters. + +#### Paint effect + +```YAML +custom_filter: edgedetect=mode=colormix:high=0[c_v_out] +``` + +Check ffmpeg [filters](https://ffmpeg.org/ffmpeg-filters.html) documentation, and find out which other filters ffmpeg has. + diff --git a/lib/src/utils/mod.rs b/lib/src/utils/mod.rs index bd04decd..025df605 100644 --- a/lib/src/utils/mod.rs +++ b/lib/src/utils/mod.rs @@ -670,7 +670,7 @@ pub fn stderr_reader(buffer: BufReader, suffix: &str, mut proc_cont format_log_line(line.clone(), "fatal") ); - if line.contains("Invalid argument") { + if line.contains("Invalid argument") || line.contains("Numerical result") { proc_control.kill_all(); exit(1); }