Black screening works
This commit is contained in:
parent
1e2fb1bb4f
commit
25ca77c69b
21
src/main.rs
21
src/main.rs
|
@ -29,9 +29,10 @@ fn record_screen(config: &mut Config, valid_screens: &Vec<String>) -> Result<Chi
|
||||||
if valid_screens.len() == 0 {
|
if valid_screens.len() == 0 {
|
||||||
let cmd = Command::new("ffmpeg")
|
let cmd = Command::new("ffmpeg")
|
||||||
.args(&[
|
.args(&[
|
||||||
"--i",
|
"-f",
|
||||||
"color=size=1920x1080:rate=25:color=black",
|
"lavfi",
|
||||||
"--f=lavfi",
|
"-i",
|
||||||
|
"color=c=black:s=1920x1080:r=25/1",
|
||||||
"-vcodec",
|
"-vcodec",
|
||||||
"rawvideo",
|
"rawvideo",
|
||||||
"-pix_fmt",
|
"-pix_fmt",
|
||||||
|
@ -51,6 +52,7 @@ fn record_screen(config: &mut Config, valid_screens: &Vec<String>) -> Result<Chi
|
||||||
} else {
|
} else {
|
||||||
let index = get_screen_index(&valid_screens[0]);
|
let index = get_screen_index(&valid_screens[0]);
|
||||||
let output_str = format!("--file={}", config.output.as_str());
|
let output_str = format!("--file={}", config.output.as_str());
|
||||||
|
println!("Outputting to {}", output_str);
|
||||||
let mut cmd = Command::new("wf-recorder")
|
let mut cmd = Command::new("wf-recorder")
|
||||||
.args(&[
|
.args(&[
|
||||||
"--muxer=v4l2",
|
"--muxer=v4l2",
|
||||||
|
@ -94,10 +96,14 @@ fn get_valid_screens_for_recording(config: &Config) -> Vec<String> {
|
||||||
.expect("Couldn't get current focus");
|
.expect("Couldn't get current focus");
|
||||||
|
|
||||||
let stdout = String::from_utf8(output.stdout).expect("Invalid UTF-8 from get_workspaces");
|
let stdout = String::from_utf8(output.stdout).expect("Invalid UTF-8 from get_workspaces");
|
||||||
let valid_screens = stdout.split('\n').map(|s| s.to_string()).collect();
|
let valid_screens = stdout
|
||||||
for screen in &valid_screens {
|
.split('\n')
|
||||||
println!("{}", screen);
|
.map(|s| s.to_string())
|
||||||
}
|
.filter(|s| s != "")
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
println!("Found screens: {:?}", valid_screens);
|
||||||
|
|
||||||
return valid_screens;
|
return valid_screens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +128,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
workspace_blacklist: Vec::new(),
|
workspace_blacklist: Vec::new(),
|
||||||
};
|
};
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
println!("{:?}", args);
|
|
||||||
|
|
||||||
let mut i = 1;
|
let mut i = 1;
|
||||||
loop {
|
loop {
|
||||||
|
|
Loading…
Reference in a new issue