redesign capture and settings
This commit is contained in:
@@ -1147,6 +1147,21 @@ pub(crate) fn extract_thumbnails(
|
||||
Ok(paths)
|
||||
}
|
||||
|
||||
pub(crate) fn display_preview(ffmpeg: &Path, x: i32, y: i32, width: u32, height: u32) -> Result<Vec<u8>> {
|
||||
use std::os::windows::process::CommandExt;
|
||||
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
|
||||
let output = Command::new(ffmpeg)
|
||||
.creation_flags(CREATE_NO_WINDOW)
|
||||
.args(["-hide_banner", "-loglevel", "error", "-f", "gdigrab", "-draw_mouse", "0"])
|
||||
.args(["-offset_x", &x.to_string(), "-offset_y", &y.to_string(), "-video_size", &format!("{width}x{height}")])
|
||||
.args(["-i", "desktop", "-frames:v", "1", "-vf", "scale=960:-2", "-c:v", "mjpeg", "-f", "image2pipe", "pipe:1"])
|
||||
.output().context("opening display preview")?;
|
||||
if !output.status.success() || output.stdout.is_empty() {
|
||||
bail!(ffmpeg_failure_message("display preview", output.status, &output.stderr));
|
||||
}
|
||||
Ok(output.stdout)
|
||||
}
|
||||
|
||||
pub(crate) fn mux_with_audio(
|
||||
ffmpeg: &Path,
|
||||
video: &Path,
|
||||
|
||||
Reference in New Issue
Block a user