process only.Expand description
A SourceStream adapter for reading data from external processes. This is a wrapper on top of
the async_read module.
Due to limitations with reading stdout and stderr simultaneously while piping large amounts
of data to stdin (see std::process::Stdio::piped), the child process’ stderr handle
will be redirected to a temporary file rather than piped directly into the program unless
explicitly overridden with Command::stderr_handle.
This implementation makes the assumption that any commands used will output binary data to
stdout and any error messages will be logged to stderr. You probably want to disable
Settings::cancel_on_drop when using this module in order
to ensure all error messages are flushed before the process is stopped.
Helpers for interacting with yt-dlp for extracting media from specific sites and ffmpeg for
post-processing are also included.
Structs§
- Command
- A simplified representation of an OS command that can be used to create a
SpawnedCommand. - Command
Builder - A builder object that can pipe multiple commands together and automatically configure the child process’ handles correctly.
- Ffmpeg
Convert Audio Command - Helper to construct a valid
ffmpegcommand that reads fromstdin, converts the input to the provided format, and sends the output tostdout. This is useful for performing post-processing on a media stream that needs to be converted to a different format. - Process
Stream - A
SourceStreamimplementation that asynchronously reads thestdoutbyte stream from atokio::process::Command. - Process
Stream Params - Parameters for creating a
ProcessStream. - Spawned
Command - A representation of a
tokio::process::Commandthat’s been spawned. - YtDlp
Command - Helper to construct a valid
yt-dlpcommand that outputs tostdout.
Traits§
- Spawn
Command - Trait used by objects that can spawn a command suitable for use with a
ProcessStream.