Struct ffmpeg_sidecar::command::FfmpegCommand
source · pub struct FfmpegCommand { /* private fields */ }Expand description
A wrapper around std::process::Command with some convenient preset argument
sets and customization for ffmpeg specifically.
Implementations§
source§impl FfmpegCommand
impl FfmpegCommand
sourcepub fn testsrc(&mut self) -> &mut Self
pub fn testsrc(&mut self) -> &mut Self
Generate a procedural test video.
Equivalent to ffmpeg -i lavfi -f testsrc
sourcepub fn rawvideo(&mut self) -> &mut Self
pub fn rawvideo(&mut self) -> &mut Self
Preset for emitting raw decoded video frames on stdout.
Equivalent to -f rawvideo -pix_fmt rgb24 -.
sourcepub fn pipe_stdout(&mut self) -> &mut Self
pub fn pipe_stdout(&mut self) -> &mut Self
Configure the ffmpeg command to produce output on stdout.
Synchronizes two changes:
- Pass
pipe:1to the ffmpeg command (“output on stdout”) - Set the
stdoutfield of the innerCommandtoStdio::piped()
sourcepub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Adds an argument to pass to the program.
Identical to arg in std::process::Command.
sourcepub fn args<I, S>(&mut self, args: I) -> &mut Selfwhere
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
pub fn args<I, S>(&mut self, args: I) -> &mut Selfwhere I: IntoIterator<Item = S>, S: AsRef<OsStr>,
Adds multiple arguments to pass to the program.
Identical to args in std::process::Command.
sourcepub fn get_args(&self) -> CommandArgs<'_>
pub fn get_args(&self) -> CommandArgs<'_>
Returns an iterator of the arguments that will be passed to the program.
Identical to get_args in std::process::Command.
sourcepub fn spawn(&mut self) -> Result<FfmpegChild>
pub fn spawn(&mut self) -> Result<FfmpegChild>
Spawn the ffmpeg command as a child process, wrapping it in a
FfmpegChild interface.
Identical to spawn in std::process::Command.
sourcepub fn print_command(&mut self) -> &mut Self
pub fn print_command(&mut self) -> &mut Self
Print a command that can be copy-pasted to run in the terminal.
Requires &mut self so that it chains seamlessly with other methods in the interface.
pub fn new() -> Self
pub fn new_with_exe<S: AsRef<OsStr>>(exe: S) -> Self
sourcepub fn as_inner_mut(&mut self) -> &mut Command
pub fn as_inner_mut(&mut self) -> &mut Command
Escape hatch to mutably access the inner Command.