pub struct FfmpegTask { /* private fields */ }Expand description
FFmpeg task builder for running host-side transcoding.
§Example
use vtx_sdk::prelude::*;
fn handle_video(vid: String) -> VtxResult<Response> {
FfmpegTask::new("mini", vid)
.option("ss", "10")
.option("t", "30")
.execute()
}Implementations§
Source§impl FfmpegTask
impl FfmpegTask
Sourcepub fn new(profile: impl Into<String>, input_id: impl Into<String>) -> Self
pub fn new(profile: impl Into<String>, input_id: impl Into<String>) -> Self
Create a new FFmpeg task.
profile: Target FFmpeg profile (e.g., “mini”, “remux”, “thumbnail”).input_id: Input resource ID (UUID) or “pipe:0”.
Sourcepub fn new_pipe(profile: impl Into<String>) -> Self
pub fn new_pipe(profile: impl Into<String>) -> Self
Create a task that uses stdin as input (input_id = "pipe:0").
Sourcepub fn option(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn option(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a key/value FFmpeg option (encoded as -key=value).
Sourcepub fn flag(self, key: impl Into<String>) -> Self
pub fn flag(self, key: impl Into<String>) -> Self
Add a flag-style FFmpeg option (encoded as -key).
Sourcepub fn seek(self, start: &str, duration: Option<&str>) -> Self
pub fn seek(self, start: &str, duration: Option<&str>) -> Self
Helper: Set seek window (equivalent to -ss + optional -t).
Sourcepub fn build(self) -> TranscodeProfile
pub fn build(self) -> TranscodeProfile
Builds the TranscodeProfile payload.
Sourcepub fn execute_buffer(self) -> VtxResult<Buffer>
pub fn execute_buffer(self) -> VtxResult<Buffer>
Execute and return the stdout pipe buffer.
This method performs an IO operation.
Sourcepub fn execute(self) -> VtxResult<HttpResponse>
pub fn execute(self) -> VtxResult<HttpResponse>
Execute and return an HTTP response (200 with stdout pipe body).
This method performs an IO operation.
Auto Trait Implementations§
impl Freeze for FfmpegTask
impl RefUnwindSafe for FfmpegTask
impl Send for FfmpegTask
impl Sync for FfmpegTask
impl Unpin for FfmpegTask
impl UnwindSafe for FfmpegTask
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