Merge pull request #607 from jb-alvarado/master

fix #604 #605 #606, add mising translation
This commit is contained in:
jb-alvarado 2024-04-19 09:13:49 +00:00 committed by GitHub
commit 2315f06499
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 161 additions and 98 deletions

68
Cargo.lock generated
View File

@ -88,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
dependencies = [
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -126,7 +126,7 @@ dependencies = [
"parse-size",
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -239,7 +239,7 @@ dependencies = [
"actix-router",
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -586,7 +586,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -841,7 +841,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -1001,7 +1001,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -1012,7 +1012,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [
"darling_core",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -1216,7 +1216,7 @@ checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
[[package]]
name = "ffplayout"
version = "0.21.1"
version = "0.21.2"
dependencies = [
"chrono",
"clap",
@ -1238,7 +1238,7 @@ dependencies = [
[[package]]
name = "ffplayout-api"
version = "0.21.1"
version = "0.21.2"
dependencies = [
"actix-files",
"actix-multipart",
@ -1277,7 +1277,7 @@ dependencies = [
[[package]]
name = "ffplayout-lib"
version = "0.21.1"
version = "0.21.2"
dependencies = [
"chrono",
"crossbeam-channel",
@ -1490,7 +1490,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -1727,9 +1727,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
version = "1.3.0"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f24ce812868d86d19daa79bf3bf9175bc44ea323391147a5e3abde2a283871b"
checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d"
dependencies = [
"bytes",
"futures-channel",
@ -2439,7 +2439,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -2537,9 +2537,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "proc-macro2"
version = "1.0.80"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e"
checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
dependencies = [
"unicode-ident",
]
@ -2553,7 +2553,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -2909,22 +2909,22 @@ checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
[[package]]
name = "serde"
version = "1.0.197"
version = "1.0.198"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.197"
version = "1.0.198"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -2994,7 +2994,7 @@ checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -3404,9 +3404,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.59"
version = "2.0.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a"
checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
dependencies = [
"proc-macro2",
"quote",
@ -3421,9 +3421,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "sysinfo"
version = "0.30.10"
version = "0.30.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d7c217777061d5a2d652aea771fb9ba98b6dade657204b08c4b9604d11555b"
checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83"
dependencies = [
"cfg-if",
"core-foundation-sys",
@ -3457,7 +3457,7 @@ dependencies = [
[[package]]
name = "tests"
version = "0.21.1"
version = "0.21.2"
dependencies = [
"chrono",
"crossbeam-channel",
@ -3497,7 +3497,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -3587,7 +3587,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -3674,7 +3674,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]
@ -3866,7 +3866,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
"wasm-bindgen-shared",
]
@ -3900,7 +3900,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -4156,7 +4156,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.59",
"syn 2.0.60",
]
[[package]]

View File

@ -4,7 +4,7 @@ default-members = ["ffplayout-api", "ffplayout-engine", "tests"]
resolver = "2"
[workspace.package]
version = "0.21.1"
version = "0.21.2"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]

View File

@ -5,18 +5,18 @@ decoder:
output_param:
filters:
deinterlace: # yadif=0:-1:0
pad_scale_w: # scale={}:-1,
pad_scale_h: # scale=-1:{},
pad_video: # '{}pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2'
pad_scale_w: # scale={}:-1
pad_scale_h: # scale=-1:{}
pad_video: # pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2
fps: # fps={}
scale: # scale={}:{}
set_dar: # setdar=dar={}
fade_in: # '{}fade=in:st=0:d=0.5'
fade_out: # '{}fade=out:st={}:d=1.0'
overlay_logo_scale: # ',scale={}'
overlay_logo: # null[v];movie={}:loop=0,setpts=N/(FRAME_RATE*TB),format=rgba,colorchannelmixer=aa={}{}[l];[v][l]{}:shortest=1
overlay_logo_fade_in: # ',fade=in:st=0:d=1.0:alpha=1'
overlay_logo_fade_out: # ',fade=out:st={}:d=1.0:alpha=1'
fade_in: # fade=in:st=0:d=0.5
fade_out: # fade=out:st={}:d=1.0
overlay_logo_scale: # scale={}
overlay_logo_fade_in: # fade=in:st=0:d=1.0:alpha=1
overlay_logo_fade_out: # fade=out:st={}:d=1.0:alpha=1
overlay_logo: # null[l];[v][l]overlay={}:shortest=1
tpad: # tpad=stop_mode=add:stop_duration={}
drawtext_from_file: # drawtext=text='{}':{}{}
drawtext_from_zmq: # zmq=b=tcp\\\\://'{}',drawtext@dyntext={}

View File

@ -12,7 +12,7 @@ For changing this settings you need to have knowledge about hardware encoding wi
### Example config
Here an example with Intel QuickSync:
##### Here an example with Intel QuickSync:
```YAML
help: Changing these settings is for advanced users only! There will be no support or guarantee that ffplayout will be stable after changing them.
@ -22,18 +22,18 @@ decoder:
output_param: -c:v mpeg2_qsv -g 1 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 25000k -c:a s302m -strict -2 -sample_fmt s16 -ar 48000 -ac 2
filters:
deinterlace: deinterlace_qsv
pad_scale_w: scale_qsv={}:-1,
pad_scale_h: scale_qsv=-1:{},
pad_video: 'null' # 'pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2'
pad_scale_w: scale_qsv={}:-1
pad_scale_h: scale_qsv=-1:{}
pad_video: 'null' # pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2
fps: vpp_qsv=framerate=25
scale: scale_qsv={}:{}
set_dar: 'null' # setdar=dar={}
fade_in: 'null' # fade=in:st=0:d=0.5
fade_out: 'null' # fade=out:st={}:d=1.0
overlay_logo_scale: 'scale_qsv={}'
overlay_logo: null[v];movie={}:loop=0,setpts=N/(FRAME_RATE*TB),format=rgba,colorchannelmixer=aa={}{},hwupload=extra_hw_frames=64,format=qsv[l];[v][l]overlay_qsv={}:shortest=1
overlay_logo_fade_in: 'null' # ',fade=in:st=0:d=1.0:alpha=1'
overlay_logo_fade_out: 'null' # ',fade=out:st={}:d=1.0:alpha=1'
overlay_logo_scale: 'null'
overlay_logo_fade_in: fade=in:st=0:d=1.0 # fade=in:st=0:d=1.0:alpha=1
overlay_logo_fade_out: fade=out:st={}:d=1.0 # fade=out:st={}:d=1.0:alpha=1
overlay_logo: hwupload=extra_hw_frames=64,format=qsv[l];[v][l]overlay_qsv={}:shortest=1
tpad: 'null' # tpad=stop_mode=add:stop_duration={}
drawtext_from_file: hwdownload,format=nv12,drawtext=text='{}':{}{} # drawtext=text='{}':{}{}
drawtext_from_zmq: hwdownload,format=nv12,zmq=b=tcp\\://'{}',drawtext@dyntext={} # zmq=b=tcp\\\\://'{}',drawtext@dyntext={}
@ -50,6 +50,43 @@ ingest:
input_param: -hwaccel qsv -init_hw_device qsv=hw -filter_hw_device hw -hwaccel_output_format qsv
```
##### Here an example with Nvidia HW processing
```YAML
help: Changing these settings is for advanced users only! There will be no support or guarantee that it will be stable after changing them.
decoder:
input_param: -thread_queue_size 1024 -hwaccel_device 0 -hwaccel cuvid -hwaccel_output_format cuda
# output_param get also applied to ingest instance.
output_param: -c:v h264_nvenc -preset p2 -tune ll -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 25000k -c:a s302m -strict -2 -sample_fmt s16 -ar 48000 -ac 2
filters:
deinterlace: 'null'
pad_scale_w: 'null' # scale={}:-1
pad_scale_h: 'null' # scale=-1:{}
pad_video: 'null' # pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2
fps: 'null' # fps={}
scale: scale_cuda={}:{}:interp_algo=lanczos:force_original_aspect_ratio=decrease # scale={}:{}
set_dar: 'null' # setdar=dar={}
fade_in: hwdownload,format=nv12,fade=in:st=0:d=0.5,format=nv12,hwupload_cuda # fade=in:st=0:d=0.5
fade_out: hwdownload,format=nv12,fade=out:st={}:d=1.0,format=nv12,hwupload_cuda # fade=out:st={}:d=1.0
overlay_logo_scale: 'null' # scale={}
overlay_logo_fade_in: fade=in:st=0:d=1.0 # fade=in:st=0:d=1.0:alpha=1
overlay_logo_fade_out: fade=out:st={}:d=1.0 # fade=out:st={}:d=1.0:alpha=1
overlay_logo: format=nv12,hwupload_cuda[l];[v][l]overlay_cuda=W-w-12:12:shortest=1,hwdownload,format=nv12
tpad: # tpad=stop_mode=add:stop_duration={}
drawtext_from_file: # drawtext=text='{}':{}{}
drawtext_from_zmq: # zmq=b=tcp\\\\://'{}',drawtext@dyntext={}
aevalsrc: # aevalsrc=0:channel_layout=stereo:duration={}:sample_rate=48000
afade_in: # afade=in:st=0:d=0.5
afade_out: # afade=out:st={}:d=1.0
apad: # apad=whole_dur={}
volume: # volume={}
split: # split={}{}
encoder:
input_param:
ingest:
input_param: -thread_queue_size 1024 -hwaccel_device 0 -hwaccel cuvid -hwaccel_output_format cuda
```
---
**At the moment this function is _experimental_, if you think you found a bug: check full decoder/encoder/ingest command with ffmpeg in terminal. When there the command works you can open a bug report issue.**

View File

@ -186,19 +186,19 @@ impl CurrentProgram {
}
// Check if last and/or next clip is a advertisement.
fn last_next_ad(&mut self) {
fn last_next_ad(&mut self, node: &mut Media) {
let index = self.player_control.current_index.load(Ordering::SeqCst);
let current_list = self.player_control.current_list.lock().unwrap();
if index + 1 < current_list.len() && &current_list[index + 1].category == "advertisement" {
self.current_node.next_ad = true;
node.next_ad = true;
}
if index > 0
&& index < current_list.len()
&& &current_list[index - 1].category == "advertisement"
{
self.current_node.last_ad = true;
node.last_ad = true;
}
}
@ -259,10 +259,7 @@ impl CurrentProgram {
if !self.playout_stat.list_init.load(Ordering::SeqCst) {
let time_sec = self.get_current_time();
let index = self
.player_control
.current_index
.fetch_add(1, Ordering::SeqCst);
let index = self.player_control.current_index.load(Ordering::SeqCst);
let nodes = self.player_control.current_list.lock().unwrap();
let last_index = nodes.len() - 1;
@ -277,6 +274,12 @@ impl CurrentProgram {
node_clone.seek += time_sec
- (node_clone.begin.unwrap() - *self.playout_stat.time_shift.lock().unwrap());
self.last_next_ad(&mut node_clone);
self.player_control
.current_index
.fetch_add(1, Ordering::SeqCst);
self.current_node = handle_list_init(
&self.config,
node_clone,
@ -306,6 +309,8 @@ impl CurrentProgram {
media.duration = total_delta;
media.out = total_delta;
self.last_next_ad(&mut media);
self.current_node = gen_source(
&self.config,
media,
@ -319,7 +324,6 @@ impl CurrentProgram {
.lock()
.unwrap()
.push(self.current_node.clone());
self.last_next_ad();
self.current_node.last_ad = self.last_node_ad;
self.current_node
@ -386,6 +390,8 @@ impl Iterator for CurrentProgram {
media.duration = total_delta;
media.out = total_delta;
self.last_next_ad(&mut media);
self.current_node = gen_source(
&self.config,
media,
@ -395,8 +401,6 @@ impl Iterator for CurrentProgram {
);
}
self.last_next_ad();
return Some(self.current_node.clone());
}
@ -408,7 +412,7 @@ impl Iterator for CurrentProgram {
let mut is_last = false;
let index = self.player_control.current_index.load(Ordering::SeqCst);
let node_list = self.player_control.current_list.lock().unwrap();
let node = node_list[index].clone();
let mut node = node_list[index].clone();
let last_index = node_list.len() - 1;
drop(node_list);
@ -417,6 +421,8 @@ impl Iterator for CurrentProgram {
is_last = true
}
self.last_next_ad(&mut node);
self.current_node = timed_source(
node,
&self.config,
@ -426,7 +432,6 @@ impl Iterator for CurrentProgram {
last_index,
);
self.last_next_ad();
self.player_control
.current_index
.fetch_add(1, Ordering::SeqCst);
@ -450,7 +455,7 @@ impl Iterator for CurrentProgram {
// Get first clip from next playlist.
let c_list = self.player_control.current_list.lock().unwrap();
let first_node = c_list[0].clone();
let mut first_node = c_list[0].clone();
drop(c_list);
@ -459,6 +464,9 @@ impl Iterator for CurrentProgram {
}
self.player_control.current_index.store(0, Ordering::SeqCst);
self.last_next_ad(&mut first_node);
first_node.last_ad = self.last_node_ad;
self.current_node = gen_source(
&self.config,
first_node,
@ -466,8 +474,7 @@ impl Iterator for CurrentProgram {
&self.player_control,
0,
);
self.last_next_ad();
self.current_node.last_ad = self.last_node_ad;
self.player_control.current_index.store(1, Ordering::SeqCst);
Some(self.current_node.clone())

@ -1 +1 @@
Subproject commit 497ddcf0ade46b246dd2beb42c0cdf702c11c121
Subproject commit 76cbc901c1891efa46836b94dc9b9e30e77c4d83

View File

@ -203,12 +203,16 @@ fn pad(aspect: f64, chain: &mut Filters, v_stream: &ffprobe::Stream, config: &Pl
if let (Some(w), Some(h)) = (v_stream.width, v_stream.height) {
if w > config.processing.width && aspect > config.processing.aspect {
scale = match &ADVANCED_CONFIG.decoder.filters.pad_scale_w {
Some(pad_scale_w) => custom_format(pad_scale_w, &[&config.processing.width]),
Some(pad_scale_w) => {
custom_format(&format!("{pad_scale_w},"), &[&config.processing.width])
}
None => format!("scale={}:-1,", config.processing.width),
};
} else if h > config.processing.height && aspect < config.processing.aspect {
scale = match &ADVANCED_CONFIG.decoder.filters.pad_scale_h {
Some(pad_scale_h) => custom_format(pad_scale_h, &[&config.processing.width]),
Some(pad_scale_h) => {
custom_format(&format!("{pad_scale_h},"), &[&config.processing.width])
}
None => format!("scale=-1:{},", config.processing.height),
};
}
@ -345,46 +349,58 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
&& Path::new(&config.processing.logo).is_file()
&& &node.category != "advertisement"
{
let mut scale = String::new();
if !config.processing.logo_scale.is_empty() {
scale = match &ADVANCED_CONFIG.decoder.filters.overlay_logo_scale {
Some(logo_scale) => {
custom_format(&format!(",{logo_scale}"), &[&config.processing.logo_scale])
}
None => format!(",scale={}", config.processing.logo_scale),
}
}
let mut logo_chain = match &ADVANCED_CONFIG.decoder.filters.overlay_logo {
Some(overlay) => custom_format(overlay, &[
&config.processing.logo.replace('\\', "/").replace(':', "\\\\:"),
&config.processing.logo_opacity.to_string(),
&scale.to_string(),
&config.processing.logo_position,
]),
None => format!(
"null[v];movie={}:loop=0,setpts=N/(FRAME_RATE*TB),format=rgba,colorchannelmixer=aa={}{scale}[l];[v][l]overlay={}:shortest=1",
config.processing.logo.replace('\\', "/").replace(':', "\\\\:"), config.processing.logo_opacity, config.processing.logo_position
)
};
let mut logo_chain = format!(
"null[v];movie={}:loop=0,setpts=N/(FRAME_RATE*TB),format=rgba,colorchannelmixer=aa={}",
config
.processing
.logo
.replace('\\', "/")
.replace(':', "\\\\:"),
config.processing.logo_opacity,
);
if node.last_ad {
match &ADVANCED_CONFIG.decoder.filters.overlay_logo_fade_in {
Some(fade_in) => logo_chain.push_str(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"),
}
};
}
if node.next_ad {
let length = node.out - node.seek - 1.0;
match &ADVANCED_CONFIG.decoder.filters.overlay_logo_fade_out {
Some(fade_out) => logo_chain.push_str(&custom_format(fade_out, &[length])),
Some(fade_out) => {
logo_chain.push_str(&custom_format(&format!(",{fade_out}"), &[length]))
}
None => logo_chain.push_str(&format!(",fade=out:st={length}:d=1.0:alpha=1")),
}
}
if !config.processing.logo_scale.is_empty() {
match &ADVANCED_CONFIG.decoder.filters.overlay_logo_scale {
Some(logo_scale) => logo_chain.push_str(&custom_format(
&format!(",{logo_scale}"),
&[&config.processing.logo_scale],
)),
None => logo_chain.push_str(&format!(",scale={}", config.processing.logo_scale)),
}
}
match &ADVANCED_CONFIG.decoder.filters.overlay_logo {
Some(overlay) => {
if !overlay.starts_with(',') {
logo_chain.push(',');
}
logo_chain.push_str(&custom_format(overlay, &[&config.processing.logo_position]))
}
None => logo_chain.push_str(&format!(
"[l];[v][l]overlay={}:shortest=1",
config.processing.logo_position
)),
};
chain.add_filter(&logo_chain, 0, Video);
}
}

View File

@ -52,9 +52,9 @@ pub struct Filters {
pub fade_in: Option<String>,
pub fade_out: Option<String>,
pub overlay_logo_scale: Option<String>,
pub overlay_logo: Option<String>,
pub overlay_logo_fade_in: Option<String>,
pub overlay_logo_fade_out: Option<String>,
pub overlay_logo: Option<String>,
pub tpad: Option<String>,
pub drawtext_from_file: Option<String>,
pub drawtext_from_zmq: Option<String>,
@ -80,7 +80,10 @@ impl AdvancedConfig {
}
if let Ok(f) = File::open(&config_path) {
config = serde_yaml::from_reader(f).expect("Could not read advanced config file");
config = match serde_yaml::from_reader(f) {
Ok(yaml) => yaml,
Err(_) => AdvancedConfig::default(),
};
if let Some(input_parm) = &config.decoder.input_param {
config.decoder.input_cmd = split(input_parm);