pub struct TranscodeProfile {
pub name: String,
pub description: Option<String>,
pub version: u32,
pub video: VideoProfileParams,
pub audio: AudioProfileParams,
pub container: ContainerParams,
pub multi_pass: MultiPassMode,
pub tags: Vec<(String, String)>,
}Expand description
A complete, shareable encoding configuration.
§Example (round-trip)
use oximedia_transcode::transcode_profile::TranscodeProfile;
let profile = TranscodeProfile::youtube_1080p();
let json = profile.to_json().expect("serialise");
let loaded = TranscodeProfile::from_json(&json).expect("deserialise");
assert_eq!(loaded.name, profile.name);Fields§
§name: StringHuman-readable name for this profile (e.g. "YouTube 1080p").
description: Option<String>Optional description explaining intended use.
version: u32Profile schema version (for future migrations).
video: VideoProfileParamsVideo encoding parameters.
audio: AudioProfileParamsAudio encoding parameters.
container: ContainerParamsContainer / muxer parameters.
multi_pass: MultiPassModeMulti-pass encoding mode.
Arbitrary key/value tags for tooling metadata.
Implementations§
Source§impl TranscodeProfile
impl TranscodeProfile
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sets the description.
Sourcepub fn video(self, params: VideoProfileParams) -> Self
pub fn video(self, params: VideoProfileParams) -> Self
Sets the video parameters.
Sourcepub fn audio(self, params: AudioProfileParams) -> Self
pub fn audio(self, params: AudioProfileParams) -> Self
Sets the audio parameters.
Sourcepub fn container(self, params: ContainerParams) -> Self
pub fn container(self, params: ContainerParams) -> Self
Sets the container parameters.
Sourcepub fn multi_pass(self, mode: MultiPassMode) -> Self
pub fn multi_pass(self, mode: MultiPassMode) -> Self
Sets the multi-pass mode.
Sourcepub fn tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds a tag to the profile.
Sourcepub fn youtube_1080p() -> Self
pub fn youtube_1080p() -> Self
YouTube 1080p upload profile (H.264 + AAC).
Sourcepub fn podcast_opus() -> Self
pub fn podcast_opus() -> Self
Podcast / audio-only Opus profile (EBU R128 normalised).
Sourcepub fn av1_1080p_archive() -> Self
pub fn av1_1080p_archive() -> Self
AV1 1080p archive profile (CRF 28, tile-based parallel).
Sourcepub fn to_json(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
Serialises the profile to a JSON string.
§Errors
Returns an error if serialisation fails (should not happen for valid profiles).
Sourcepub fn to_json_compact(&self) -> Result<String>
pub fn to_json_compact(&self) -> Result<String>
Serialises the profile to a compact (non-pretty) JSON string.
§Errors
Returns an error if serialisation fails.
Sourcepub fn from_json(json: &str) -> Result<Self>
pub fn from_json(json: &str) -> Result<Self>
Deserialises a profile from a JSON string.
§Errors
Returns an error if the JSON is malformed or the schema does not match.
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Sourcepub fn load_from_file(path: &Path) -> Result<Self>
pub fn load_from_file(path: &Path) -> Result<Self>
Trait Implementations§
Source§impl Clone for TranscodeProfile
impl Clone for TranscodeProfile
Source§fn clone(&self) -> TranscodeProfile
fn clone(&self) -> TranscodeProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TranscodeProfile
impl Debug for TranscodeProfile
Source§impl<'de> Deserialize<'de> for TranscodeProfile
impl<'de> Deserialize<'de> for TranscodeProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TranscodeProfile
impl PartialEq for TranscodeProfile
Source§impl Serialize for TranscodeProfile
impl Serialize for TranscodeProfile
impl StructuralPartialEq for TranscodeProfile
Auto Trait Implementations§
impl Freeze for TranscodeProfile
impl RefUnwindSafe for TranscodeProfile
impl Send for TranscodeProfile
impl Sync for TranscodeProfile
impl Unpin for TranscodeProfile
impl UnsafeUnpin for TranscodeProfile
impl UnwindSafe for TranscodeProfile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more