🎥 Make videos programmatically with React
filter
Jonny Burgerf3843147c538
diff --git a/packages/renderer/rust/commands/mod.rs b/packages/renderer/rust/commands/mod.rsindex f8f837314e..4963d5f360 100644--- a/packages/renderer/rust/commands/mod.rs+++ b/packages/renderer/rust/commands/mod.rs@@ -1,5 +1,6 @@use crate::compositor::draw_layer;use crate::errors::ErrorWithBacktrace;+use crate::global_printer::_print_verbose;use crate::image::{save_as_jpeg, save_as_png};use crate::opened_video_manager::OpenedVideoManager;use crate::payloads::payloads::CliInputCommandPayload;@@ -51,10 +52,14 @@ pub fn execute_command(opts: CliInputCommandPayload) -> Result<Vec<u8>, ErrorWitOk(str.as_bytes().to_vec())}CliInputCommandPayload::GetSilences(_command) => {+ let filter = format!(+ "silencedetect=n={}dB:d={}",+ _command.noiseThresholdInDecibel, _command.minDuration+ );let res = get_silences::get_silences(_command.src,"out.mp3".to_string(),- "silencedetect=n=-20dB:d=1".to_string(),+ filter.to_string(),)?;let str = serde_json::to_string(&res)?;Ok(str.as_bytes().to_vec())diff --git a/packages/renderer/rust/payloads.rs b/packages/renderer/rust/payloads.rsindex 1cb32de20a..356c9ffdcb 100644--- a/packages/renderer/rust/payloads.rs+++ b/packages/renderer/rust/payloads.rs@@ -63,8 +63,11 @@ pub mod payloads {}#[derive(Serialize, Deserialize, Debug)]+ #[allow(non_snake_case)]pub struct GetSilences {pub src: String,+ pub noiseThresholdInDecibel: f64,+ pub minDuration: f64,}#[derive(Serialize, Deserialize, Debug)]diff --git a/packages/renderer/src/compositor/payloads.ts b/packages/renderer/src/compositor/payloads.tsindex 4130650067..1416cc3b43 100644--- a/packages/renderer/src/compositor/payloads.ts+++ b/packages/renderer/src/compositor/payloads.ts@@ -66,6 +66,8 @@ export type CompositorCommand = {};GetSilences: {src: string;+ noiseThresholdInDecibel: number;+ minDuration: number;};Echo: {message: string;