Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

wip: Further along

Richie McIlroybced2c0c734c
diff --git a/apps/desktop-solid/src-tauri/src/ffmpeg.rs b/apps/desktop-solid/src-tauri/src/ffmpeg.rs
index 26ca276f1..e48b6f14a 100644
--- a/apps/desktop-solid/src-tauri/src/ffmpeg.rs
+++ b/apps/desktop-solid/src-tauri/src/ffmpeg.rs
@@ -56,6 +56,9 @@ impl FFmpegProcess {
self.ffmpeg_stdin.write_all(b"q")?;
println!("Sent quit command to FFmpeg");
+ self.cmd.wait();
+ println!("FFmpeg exited");
+
// Wait for the process to exit
let timeout = std::time::Duration::from_secs(5);
match self.wait_with_timeout(timeout)? {
@@ -91,7 +94,7 @@ impl FFmpegProcess {
}
pub fn wait(&mut self) -> std::io::Result<std::process::ExitStatus> {
- self.ffmpeg_process.wait()
+ self.cmd.wait()
}
pub fn kill(&mut self) {
diff --git a/apps/desktop-solid/src-tauri/src/video_renderer.rs b/apps/desktop-solid/src-tauri/src/video_renderer.rs
index 594db20d3..57b765c89 100644
--- a/apps/desktop-solid/src-tauri/src/video_renderer.rs
+++ b/apps/desktop-solid/src-tauri/src/video_renderer.rs
@@ -290,23 +290,11 @@ pub async fn render_video(options: RenderOptions) -> Result<PathBuf> {
println!("All frames sent to FFmpeg");
ffmpeg_process.ffmpeg_stdin.flush().unwrap();
ffmpeg_process.ffmpeg_stdin.write_all(b"q").unwrap();
+ ffmpeg_process.wait().unwrap();
break;
}
}
}
-
- match ffmpeg_process.wait_with_timeout(std::time::Duration::from_secs(10)) {
- Ok(Some(status)) => println!("FFmpeg exited with status: {}", status),
- Ok(None) => {
- println!("FFmpeg did not exit within the timeout period. Attempting to terminate.");
- ffmpeg_process.kill();
- match ffmpeg_process.wait() {
- Ok(status) => println!("FFmpeg terminated with status: {}", status),
- Err(e) => eprintln!("Error waiting for FFmpeg to terminate: {}", e),
- }
- }
- Err(e) => eprintln!("Error waiting for FFmpeg to exit: {}", e),
- }
});
let mut screen_command = Command::new(&ffmpeg_binary_path_str);