You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use scap::{
capturer::{Capturer,Options},
frame::Frame,Target,};fnmain(){if !scap::is_supported(){println!("❌ Platform not supported");return;}if !scap::has_permission(){println!("❌ Permission not granted. Requesting permission...");if !scap::request_permission(){println!("❌ Permission denied");return;}}// Get all available targets (windows)let targets = scap::get_all_targets();// filter only to be Target::Windowlet targets:Vec<Target> = targets
.into_iter().filter(|target| matches!(target,Target::Window(_))).collect();for target in targets {let options = Options{fps:60,show_cursor:true,show_highlight:true,excluded_targets:None,output_type: scap::frame::FrameType::BGRAFrame,output_resolution: scap::capturer::Resolution::_720p,target:Some(target.clone()),
..Default::default()};letmut recorder = Capturer::new(options);
recorder.start_capture();// Capture 10 frames from each windowfor i in0..10{ifletOk(frame) = recorder.get_next_frame(){match frame {Frame::BGRA(frame) => {println!("Received BGRA frame {} of width {} and height {} at time {}",
i, frame.width, frame.height, frame.display_time
);}// Handle other frame types if needed
_ => println!("Received non-BGRA frame"),}}else{println!("Error capturing frame");}}
recorder.stop_capture();}}
"Failed due to an invalid parameter"
here
#[cfg(target_os = "macos")]{// self.mac.add_output(Capturer::new(tx));self.mac.start_capture().expect("Failed to start capture");}
The text was updated successfully, but these errors were encountered:
mac book bro m3 14.5
here
The text was updated successfully, but these errors were encountered: