use named drawtext filter instead of index
This commit is contained in:
parent
bc290678d7
commit
84addbcb2a
@ -64,22 +64,6 @@ fn ingest_to_hls_server(
|
||||
|
||||
loop {
|
||||
let filters = filter_chains(&config, &mut dummy_media, &playout_stat.chain);
|
||||
|
||||
if filters.len() > 1 {
|
||||
// get correct filter index from drawtext node for zmq
|
||||
let filter_chain = filters[1]
|
||||
.split_terminator([',', ';'])
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
for (i, link) in filter_chain.iter().enumerate() {
|
||||
if link.contains("drawtext") {
|
||||
playout_stat
|
||||
.drawtext_server_index
|
||||
.store(i, Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let server_cmd = prepare_output_cmd(server_prefix.clone(), filters, &config);
|
||||
|
||||
debug!(
|
||||
|
@ -92,10 +92,7 @@ pub fn json_rpc_server(
|
||||
|
||||
if config.out.mode == HLS {
|
||||
if proc.server_is_running.load(Ordering::SeqCst) {
|
||||
let filter_server = format!(
|
||||
"Parsed_drawtext_{} reinit {filter}",
|
||||
playout_stat.drawtext_server_index.load(Ordering::SeqCst)
|
||||
);
|
||||
let filter_server = format!("drawtext@dyntext reinit {filter}");
|
||||
|
||||
if let Ok(reply) = block_on(zmq_send(
|
||||
&filter_server,
|
||||
@ -109,10 +106,7 @@ pub fn json_rpc_server(
|
||||
}
|
||||
|
||||
if config.out.mode != HLS || !proc.server_is_running.load(Ordering::SeqCst) {
|
||||
let filter_stream = format!(
|
||||
"Parsed_drawtext_{} reinit {filter}",
|
||||
playout_stat.drawtext_stream_index.load(Ordering::SeqCst)
|
||||
);
|
||||
let filter_stream = format!("drawtext@dyntext reinit {filter}");
|
||||
|
||||
if let Ok(reply) = block_on(zmq_send(
|
||||
&filter_stream,
|
||||
|
@ -52,7 +52,7 @@ pub fn filter_node(
|
||||
}
|
||||
|
||||
filter = format!(
|
||||
"zmq=b=tcp\\\\://'{}',drawtext={filter_cmd}",
|
||||
"zmq=b=tcp\\\\://'{}',drawtext@dyntext={filter_cmd}",
|
||||
socket.replace(':', "\\:")
|
||||
)
|
||||
}
|
||||
|
@ -187,8 +187,6 @@ pub struct PlayoutStatus {
|
||||
pub date: Arc<Mutex<String>>,
|
||||
pub list_init: Arc<AtomicBool>,
|
||||
pub time_shift: Arc<Mutex<f64>>,
|
||||
pub drawtext_server_index: Arc<AtomicUsize>,
|
||||
pub drawtext_stream_index: Arc<AtomicUsize>,
|
||||
}
|
||||
|
||||
impl PlayoutStatus {
|
||||
@ -199,8 +197,6 @@ impl PlayoutStatus {
|
||||
date: Arc::new(Mutex::new(String::new())),
|
||||
list_init: Arc::new(AtomicBool::new(true)),
|
||||
time_shift: Arc::new(Mutex::new(0.0)),
|
||||
drawtext_server_index: Arc::new(AtomicUsize::new(2)),
|
||||
drawtext_stream_index: Arc::new(AtomicUsize::new(2)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ fn video_dual_audio_filter_stream() {
|
||||
"-i",
|
||||
"pipe:0",
|
||||
"-filter_complex",
|
||||
format!("[0:v]null,zmq=b=tcp\\\\://'{socket}',drawtext=text=''[v_out1]"),
|
||||
format!("[0:v]null,zmq=b=tcp\\\\://'{socket}',drawtext@dyntext=text=''[v_out1]"),
|
||||
"-map",
|
||||
"[v_out1]",
|
||||
"-map",
|
||||
@ -657,7 +657,7 @@ fn video_dual_audio_multi_filter_stream() {
|
||||
"-i",
|
||||
"pipe:0",
|
||||
"-filter_complex",
|
||||
format!("[0:v]null,zmq=b=tcp\\\\://'{socket}',drawtext=text=''[v_out1]"),
|
||||
format!("[0:v]null,zmq=b=tcp\\\\://'{socket}',drawtext@dyntext=text=''[v_out1]"),
|
||||
"-map",
|
||||
"[v_out1]",
|
||||
"-map",
|
||||
|
Loading…
x
Reference in New Issue
Block a user