remove comma in settings

This commit is contained in:
jb-alvarado 2024-04-17 21:32:40 +02:00
parent bfb75747bc
commit ed59c5fd54
3 changed files with 26 additions and 20 deletions

View File

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

View File

@ -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 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: filters:
deinterlace: deinterlace_qsv deinterlace: deinterlace_qsv
pad_scale_w: scale_qsv={}:-1, pad_scale_w: scale_qsv={}:-1
pad_scale_h: 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_video: 'null' # pad=max(iw\\,ih*({0}/{1})):ow/({0}/{1}):(ow-iw)/2:(oh-ih)/2
fps: vpp_qsv=framerate=25 fps: vpp_qsv=framerate=25
scale: scale_qsv={}:{} scale: scale_qsv={}:{}
set_dar: 'null' # setdar=dar={} set_dar: 'null' # setdar=dar={}
fade_in: 'null' # fade=in:st=0:d=0.5 fade_in: 'null' # fade=in:st=0:d=0.5
fade_out: 'null' # fade=out:st={}:d=1.0 fade_out: 'null' # fade=out:st={}:d=1.0
overlay_logo_scale: 'scale_qsv={}' 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: 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_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_fade_out: 'null' # fade=out:st={}:d=1.0:alpha=1
tpad: 'null' # tpad=stop_mode=add:stop_duration={} tpad: 'null' # tpad=stop_mode=add:stop_duration={}
drawtext_from_file: hwdownload,format=nv12,drawtext=text='{}':{}{} # drawtext=text='{}':{}{} 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={} drawtext_from_zmq: hwdownload,format=nv12,zmq=b=tcp\\://'{}',drawtext@dyntext={} # zmq=b=tcp\\\\://'{}',drawtext@dyntext={}

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 let (Some(w), Some(h)) = (v_stream.width, v_stream.height) {
if w > config.processing.width && aspect > config.processing.aspect { if w > config.processing.width && aspect > config.processing.aspect {
scale = match &ADVANCED_CONFIG.decoder.filters.pad_scale_w { 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), None => format!("scale={}:-1,", config.processing.width),
}; };
} else if h > config.processing.height && aspect < config.processing.aspect { } else if h > config.processing.height && aspect < config.processing.aspect {
scale = match &ADVANCED_CONFIG.decoder.filters.pad_scale_h { 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), None => format!("scale=-1:{},", config.processing.height),
}; };
} }
@ -360,7 +364,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
Some(overlay) => custom_format(overlay, &[ Some(overlay) => custom_format(overlay, &[
&config.processing.logo.replace('\\', "/").replace(':', "\\\\:"), &config.processing.logo.replace('\\', "/").replace(':', "\\\\:"),
&config.processing.logo_opacity.to_string(), &config.processing.logo_opacity.to_string(),
&scale.to_string(), &scale,
&config.processing.logo_position, &config.processing.logo_position,
]), ]),
None => format!( None => format!(
@ -371,7 +375,7 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
if node.last_ad { if node.last_ad {
match &ADVANCED_CONFIG.decoder.filters.overlay_logo_fade_in { 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"), None => logo_chain.push_str(",fade=in:st=0:d=1.0:alpha=1"),
} }
} }
@ -380,7 +384,9 @@ fn overlay(node: &mut Media, chain: &mut Filters, config: &PlayoutConfig) {
let length = node.out - node.seek - 1.0; let length = node.out - node.seek - 1.0;
match &ADVANCED_CONFIG.decoder.filters.overlay_logo_fade_out { 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")), None => logo_chain.push_str(&format!(",fade=out:st={length}:d=1.0:alpha=1")),
} }
} }