pub struct CaptureOptions {
pub input: String,
pub chrome: PathBuf,
pub width: u32,
pub height: u32,
pub fps: u32,
pub duration_secs: f64,
pub mode: Mode,
pub no_sandbox: bool,
}Expand description
What to capture and how.
Fields§
§input: StringHTML file, or an http(s)/file URL.
chrome: PathBufPath to chrome-headless-shell.
width: u32Viewport width in CSS pixels.
height: u32Viewport height in CSS pixels.
fps: u32Frames per second.
duration_secs: f64Length of the capture in seconds.
mode: ModeHow frames are drawn and grabbed.
no_sandbox: boolRun Chrome without its sandbox (Ubuntu 23.10+; trusted pages only). Running as root always disables it, since Chrome refuses otherwise.
Implementations§
Source§impl CaptureOptions
impl CaptureOptions
Sourcepub fn new(input: impl Into<String>, chrome: impl Into<PathBuf>) -> Self
pub fn new(input: impl Into<String>, chrome: impl Into<PathBuf>) -> Self
512×512 at 30 fps for 2 seconds, Mode::Auto, sandbox on.
pub fn size(self, width: u32, height: u32) -> Self
pub fn fps(self, fps: u32) -> Self
pub fn duration_secs(self, secs: f64) -> Self
pub fn mode(self, mode: Mode) -> Self
pub fn no_sandbox(self, no_sandbox: bool) -> Self
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
How many frames the capture produces: duration × fps, rounded.
Trait Implementations§
Source§impl Clone for CaptureOptions
impl Clone for CaptureOptions
Auto Trait Implementations§
impl Freeze for CaptureOptions
impl RefUnwindSafe for CaptureOptions
impl Send for CaptureOptions
impl Sync for CaptureOptions
impl Unpin for CaptureOptions
impl UnsafeUnpin for CaptureOptions
impl UnwindSafe for CaptureOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more