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

source

pub fn testsrc(&mut self) -> &mut Self

Generate a procedural test video. Equivalent to ffmpeg -i lavfi -f testsrc

FFmpeg testsrc filter documentation

source

pub fn rawvideo(&mut self) -> &mut Self

Preset for emitting raw decoded video frames on stdout. Equivalent to -f rawvideo -pix_fmt rgb24 -.

source

pub fn pipe_stdout(&mut self) -> &mut Self

Configure the ffmpeg command to produce output on stdout.

Synchronizes two changes:

  1. Pass pipe:1 to the ffmpeg command (“output on stdout”)
  2. Set the stdout field of the inner Command to Stdio::piped()
source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn new() -> Self

source

pub fn new_with_exe<S: AsRef<OsStr>>(exe: S) -> Self

source

pub fn as_inner(&mut self) -> &Command

Escape hatch to access the inner Command.

source

pub fn as_inner_mut(&mut self) -> &mut Command

Escape hatch to mutably access the inner Command.

Trait Implementations§

source§

impl Debug for FfmpegCommand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Format the program and arguments of a Command for display. Any non-utf8 data is lossily converted using the utf8 replacement character.

source§

impl Default for FfmpegCommand

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Command> for FfmpegCommand

source§

fn from(inner: Command) -> Self

Convert a Command into a FfmpegCommand, making no guarantees about the validity of its configured arguments and stdio. For example, set_expected_loglevel() is not automatically applied, which can have unexpected effects on log parsing.

source§

impl Into<Command> for FfmpegCommand

source§

fn into(self) -> Command

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.