Skip to content

Commit

Permalink
Actually stop the terminal opening when rendering on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsEeleeya committed Nov 15, 2024
1 parent 0c6ce3f commit 8df1667
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions crates/ffmpeg-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ pub struct FFmpegProcess {

impl FFmpegProcess {
pub fn spawn(mut command: Command) -> Self {
#[cfg(target_os = "windows")]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
command.creation_flags(CREATE_NO_WINDOW);
}

let mut cmd = command.stdin(Stdio::piped()).spawn().unwrap_or_else(|e| {
println!("Failed to start FFmpeg: {}", e);
println!("Command: {:?}", command);
Expand Down
2 changes: 0 additions & 2 deletions crates/rendering/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// use cap_project::{BackgroundSource, ProjectConfiguration, RecordingMeta};

#[tokio::main]
Expand Down

0 comments on commit 8df1667

Please sign in to comment.