commit
69c08308a1
@ -6,7 +6,10 @@ input_param = ""
|
|||||||
# output_param get also applied to ingest instance.
|
# output_param get also applied to ingest instance.
|
||||||
output_param = ""
|
output_param = ""
|
||||||
|
|
||||||
[decoder.filters]
|
[encoder]
|
||||||
|
input_param = ""
|
||||||
|
|
||||||
|
[filters]
|
||||||
deinterlace = "" # yadif=0:-1:0
|
deinterlace = "" # yadif=0:-1:0
|
||||||
pad_scale_w = "" # scale={}:-1
|
pad_scale_w = "" # scale={}:-1
|
||||||
pad_scale_h = "" # scale=-1:{}
|
pad_scale_h = "" # scale=-1:{}
|
||||||
@ -30,8 +33,5 @@ apad = "" # apad=whole_dur={}
|
|||||||
volume = "" # volume={}
|
volume = "" # volume={}
|
||||||
split = "" # split={}{}
|
split = "" # split={}{}
|
||||||
|
|
||||||
[encoder]
|
|
||||||
input_param = ""
|
|
||||||
|
|
||||||
[ingest]
|
[ingest]
|
||||||
input_param = ""
|
input_param = ""
|
||||||
|
@ -189,7 +189,7 @@ fn deinterlace(field_order: &Option<String>, chain: &mut Filters, config: &Playo
|
|||||||
let deinterlace = match config
|
let deinterlace = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.deinterlace.clone())
|
.and_then(|a| a.filters.deinterlace.clone())
|
||||||
{
|
{
|
||||||
Some(deinterlace) => deinterlace,
|
Some(deinterlace) => deinterlace,
|
||||||
None => "yadif=0:-1:0".to_string(),
|
None => "yadif=0:-1:0".to_string(),
|
||||||
@ -209,7 +209,7 @@ fn pad(aspect: f64, chain: &mut Filters, v_stream: &ffprobe::Stream, config: &Pl
|
|||||||
scale = match config
|
scale = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.pad_scale_w.clone())
|
.and_then(|a| a.filters.pad_scale_w.clone())
|
||||||
{
|
{
|
||||||
Some(pad_scale_w) => {
|
Some(pad_scale_w) => {
|
||||||
custom_format(&format!("{pad_scale_w},"), &[&config.processing.width])
|
custom_format(&format!("{pad_scale_w},"), &[&config.processing.width])
|
||||||
@ -220,7 +220,7 @@ fn pad(aspect: f64, chain: &mut Filters, v_stream: &ffprobe::Stream, config: &Pl
|
|||||||
scale = match config
|
scale = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.pad_scale_h.clone())
|
.and_then(|a| a.filters.pad_scale_h.clone())
|
||||||
{
|
{
|
||||||
Some(pad_scale_h) => {
|
Some(pad_scale_h) => {
|
||||||
custom_format(&format!("{pad_scale_h},"), &[&config.processing.width])
|
custom_format(&format!("{pad_scale_h},"), &[&config.processing.width])
|
||||||
@ -233,7 +233,7 @@ fn pad(aspect: f64, chain: &mut Filters, v_stream: &ffprobe::Stream, config: &Pl
|
|||||||
let pad = match config
|
let pad = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.pad_video.clone())
|
.and_then(|a| a.filters.pad_video.clone())
|
||||||
{
|
{
|
||||||
Some(pad_video) => custom_format(
|
Some(pad_video) => custom_format(
|
||||||
&format!("{scale}{pad_video}"),
|
&format!("{scale}{pad_video}"),
|
||||||
@ -254,11 +254,7 @@ fn pad(aspect: f64, chain: &mut Filters, v_stream: &ffprobe::Stream, config: &Pl
|
|||||||
|
|
||||||
fn fps(fps: f64, chain: &mut Filters, config: &PlayoutConfig) {
|
fn fps(fps: f64, chain: &mut Filters, config: &PlayoutConfig) {
|
||||||
if fps != config.processing.fps {
|
if fps != config.processing.fps {
|
||||||
let fps_filter = match config
|
let fps_filter = match config.advanced.as_ref().and_then(|a| a.filters.fps.clone()) {
|
||||||
.advanced
|
|
||||||
.as_ref()
|
|
||||||
.and_then(|a| a.decoder.filters.fps.clone())
|
|
||||||
{
|
|
||||||
Some(fps) => custom_format(&fps, &[&config.processing.fps]),
|
Some(fps) => custom_format(&fps, &[&config.processing.fps]),
|
||||||
None => format!("fps={}", config.processing.fps),
|
None => format!("fps={}", config.processing.fps),
|
||||||
};
|
};
|
||||||
@ -280,7 +276,7 @@ fn scale(
|
|||||||
let scale = match config
|
let scale = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.scale.clone())
|
.and_then(|a| a.filters.scale.clone())
|
||||||
{
|
{
|
||||||
Some(scale) => custom_format(
|
Some(scale) => custom_format(
|
||||||
&scale,
|
&scale,
|
||||||
@ -301,7 +297,7 @@ fn scale(
|
|||||||
let dar = match config
|
let dar = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.set_dar.clone())
|
.and_then(|a| a.filters.set_dar.clone())
|
||||||
{
|
{
|
||||||
Some(set_dar) => custom_format(&set_dar, &[&config.processing.aspect]),
|
Some(set_dar) => custom_format(&set_dar, &[&config.processing.aspect]),
|
||||||
None => format!("setdar=dar={}", config.processing.aspect),
|
None => format!("setdar=dar={}", config.processing.aspect),
|
||||||
@ -313,7 +309,7 @@ fn scale(
|
|||||||
let scale = match config
|
let scale = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.scale.clone())
|
.and_then(|a| a.filters.scale.clone())
|
||||||
{
|
{
|
||||||
Some(scale) => custom_format(
|
Some(scale) => custom_format(
|
||||||
&scale,
|
&scale,
|
||||||
@ -329,7 +325,7 @@ fn scale(
|
|||||||
let dar = match config
|
let dar = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.set_dar.clone())
|
.and_then(|a| a.filters.set_dar.clone())
|
||||||
{
|
{
|
||||||
Some(set_dar) => custom_format(&set_dar, &[&config.processing.aspect]),
|
Some(set_dar) => custom_format(&set_dar, &[&config.processing.aspect]),
|
||||||
None => format!("setdar=dar={}", config.processing.aspect),
|
None => format!("setdar=dar={}", config.processing.aspect),
|
||||||
@ -364,14 +360,14 @@ fn fade(
|
|||||||
if let Some(fade) = config
|
if let Some(fade) = config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.afade_in.clone())
|
.and_then(|a| a.filters.afade_in.clone())
|
||||||
{
|
{
|
||||||
fade_in = custom_format(&fade, &[t]);
|
fade_in = custom_format(&fade, &[t]);
|
||||||
}
|
}
|
||||||
} else if let Some(fade) = config
|
} else if let Some(fade) = config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.fade_in.clone())
|
.and_then(|a| a.filters.fade_in.clone())
|
||||||
{
|
{
|
||||||
fade_in = custom_format(&fade, &[t]);
|
fade_in = custom_format(&fade, &[t]);
|
||||||
};
|
};
|
||||||
@ -386,14 +382,14 @@ fn fade(
|
|||||||
if let Some(fade) = config
|
if let Some(fade) = config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.afade_out.clone())
|
.and_then(|a| a.filters.afade_out.clone())
|
||||||
{
|
{
|
||||||
fade_out = custom_format(&fade, &[node.out - node.seek - 1.0]);
|
fade_out = custom_format(&fade, &[node.out - node.seek - 1.0]);
|
||||||
}
|
}
|
||||||
} else if let Some(fade) = config
|
} else if let Some(fade) = config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.fade_out.clone())
|
.and_then(|a| a.filters.fade_out.clone())
|
||||||
.clone()
|
.clone()
|
||||||
{
|
{
|
||||||
fade_out = custom_format(&fade, &[node.out - node.seek - 1.0]);
|
fade_out = custom_format(&fade, &[node.out - node.seek - 1.0]);
|
||||||
@ -422,7 +418,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
|
|||||||
match config
|
match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.overlay_logo_fade_in.clone())
|
.and_then(|a| a.filters.overlay_logo_fade_in.clone())
|
||||||
{
|
{
|
||||||
Some(fade_in) => logo_chain.push_str(&format!(",{fade_in}")),
|
Some(fade_in) => logo_chain.push_str(&format!(",{fade_in}")),
|
||||||
None => logo_chain.push_str(",fade=in:st=0:d=1.0:alpha=1"),
|
None => logo_chain.push_str(",fade=in:st=0:d=1.0:alpha=1"),
|
||||||
@ -435,7 +431,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
|
|||||||
match config
|
match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.overlay_logo_fade_out.clone())
|
.and_then(|a| a.filters.overlay_logo_fade_out.clone())
|
||||||
{
|
{
|
||||||
Some(fade_out) => {
|
Some(fade_out) => {
|
||||||
logo_chain.push_str(&custom_format(&format!(",{fade_out}"), &[length]))
|
logo_chain.push_str(&custom_format(&format!(",{fade_out}"), &[length]))
|
||||||
@ -448,7 +444,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
|
|||||||
match &config
|
match &config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.overlay_logo_scale.clone())
|
.and_then(|a| a.filters.overlay_logo_scale.clone())
|
||||||
{
|
{
|
||||||
Some(logo_scale) => logo_chain.push_str(&custom_format(
|
Some(logo_scale) => logo_chain.push_str(&custom_format(
|
||||||
&format!(",{logo_scale}"),
|
&format!(",{logo_scale}"),
|
||||||
@ -461,7 +457,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
|
|||||||
match config
|
match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.overlay_logo.clone())
|
.and_then(|a| a.filters.overlay_logo.clone())
|
||||||
{
|
{
|
||||||
Some(overlay) => {
|
Some(overlay) => {
|
||||||
if !overlay.starts_with(',') {
|
if !overlay.starts_with(',') {
|
||||||
@ -497,7 +493,7 @@ fn extend_video(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
|
|||||||
let tpad = match config
|
let tpad = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.tpad.clone())
|
.and_then(|a| a.filters.tpad.clone())
|
||||||
{
|
{
|
||||||
Some(pad) => custom_format(&pad, &[duration]),
|
Some(pad) => custom_format(&pad, &[duration]),
|
||||||
None => format!("tpad=stop_mode=add:stop_duration={duration}"),
|
None => format!("tpad=stop_mode=add:stop_duration={duration}"),
|
||||||
@ -528,7 +524,7 @@ fn add_audio(node: &Media, chain: &mut Filters, nr: i32, config: &PlayoutConfig)
|
|||||||
let audio = match config
|
let audio = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.aevalsrc.clone())
|
.and_then(|a| a.filters.aevalsrc.clone())
|
||||||
{
|
{
|
||||||
Some(aevalsrc) => custom_format(&aevalsrc, &[node.out - node.seek]),
|
Some(aevalsrc) => custom_format(&aevalsrc, &[node.out - node.seek]),
|
||||||
None => format!(
|
None => format!(
|
||||||
@ -554,7 +550,7 @@ fn extend_audio(node: &mut Media, chain: &mut Filters, nr: i32, config: &Playout
|
|||||||
let apad = match config
|
let apad = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.apad.clone())
|
.and_then(|a| a.filters.apad.clone())
|
||||||
{
|
{
|
||||||
Some(apad) => custom_format(&apad, &[node.out - node.seek]),
|
Some(apad) => custom_format(&apad, &[node.out - node.seek]),
|
||||||
None => format!("apad=whole_dur={}", node.out - node.seek),
|
None => format!("apad=whole_dur={}", node.out - node.seek),
|
||||||
@ -571,7 +567,7 @@ fn audio_volume(chain: &mut Filters, config: &PlayoutConfig, nr: i32) {
|
|||||||
let volume = match config
|
let volume = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.volume.clone())
|
.and_then(|a| a.filters.volume.clone())
|
||||||
{
|
{
|
||||||
Some(volume) => custom_format(&volume, &[config.processing.volume]),
|
Some(volume) => custom_format(&volume, &[config.processing.volume]),
|
||||||
None => format!("volume={}", config.processing.volume),
|
None => format!("volume={}", config.processing.volume),
|
||||||
@ -617,7 +613,7 @@ pub fn split_filter(
|
|||||||
let split = match config
|
let split = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.split.clone())
|
.and_then(|a| a.filters.split.clone())
|
||||||
{
|
{
|
||||||
Some(split) => custom_format(&split, &[count.to_string(), out_link.join("")]),
|
Some(split) => custom_format(&split, &[count.to_string(), out_link.join("")]),
|
||||||
None => format!("split={count}{}", out_link.join("")),
|
None => format!("split={count}{}", out_link.join("")),
|
||||||
|
@ -47,7 +47,7 @@ pub fn filter_node(
|
|||||||
filter = match &config
|
filter = match &config
|
||||||
.advanced
|
.advanced
|
||||||
.clone()
|
.clone()
|
||||||
.and_then(|a| a.decoder.filters.drawtext_from_file)
|
.and_then(|a| a.filters.drawtext_from_file)
|
||||||
{
|
{
|
||||||
Some(drawtext) => custom_format(drawtext, &[&escaped_text, &config.text.style, &font]),
|
Some(drawtext) => custom_format(drawtext, &[&escaped_text, &config.text.style, &font]),
|
||||||
None => format!("drawtext=text='{escaped_text}':{}{font}", config.text.style),
|
None => format!("drawtext=text='{escaped_text}':{}{font}", config.text.style),
|
||||||
@ -64,7 +64,7 @@ pub fn filter_node(
|
|||||||
filter = match config
|
filter = match config
|
||||||
.advanced
|
.advanced
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.decoder.filters.drawtext_from_zmq.clone())
|
.and_then(|a| a.filters.drawtext_from_zmq.clone())
|
||||||
{
|
{
|
||||||
Some(drawtext) => custom_format(&drawtext, &[&socket.replace(':', "\\:"), &filter_cmd]),
|
Some(drawtext) => custom_format(&drawtext, &[&socket.replace(':', "\\:"), &filter_cmd]),
|
||||||
None => format!(
|
None => format!(
|
||||||
|
@ -8,6 +8,7 @@ use shlex::split;
|
|||||||
pub struct AdvancedConfig {
|
pub struct AdvancedConfig {
|
||||||
pub decoder: DecoderConfig,
|
pub decoder: DecoderConfig,
|
||||||
pub encoder: EncoderConfig,
|
pub encoder: EncoderConfig,
|
||||||
|
pub filters: Filters,
|
||||||
pub ingest: IngestConfig,
|
pub ingest: IngestConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +19,6 @@ pub struct DecoderConfig {
|
|||||||
pub input_param: Option<String>,
|
pub input_param: Option<String>,
|
||||||
#[serde_as(as = "NoneAsEmptyString")]
|
#[serde_as(as = "NoneAsEmptyString")]
|
||||||
pub output_param: Option<String>,
|
pub output_param: Option<String>,
|
||||||
pub filters: Filters,
|
|
||||||
#[serde(skip_serializing, skip_deserializing)]
|
#[serde(skip_serializing, skip_deserializing)]
|
||||||
pub input_cmd: Option<Vec<String>>,
|
pub input_cmd: Option<Vec<String>>,
|
||||||
#[serde(skip_serializing, skip_deserializing)]
|
#[serde(skip_serializing, skip_deserializing)]
|
||||||
|
Loading…
Reference in New Issue
Block a user