Struct SyncOptions

Source
pub struct SyncOptions {
    pub interval: i64,
    pub split_mode: bool,
    pub split_penalty: f64,
    pub speed_optimization: Option<f64>,
    pub framerate_correction: bool,
}
Expand description

Options governing the synchronization process

Most of these options are passed directly to alass. See the official alass repository for details: https://github.com/kaegi/alass

  • interval: The smallest unit of time recognized by alass. Smaller numbers make the alignment more accurate, larger numbers make alignment faster. (millis)

  • split_mode: When true, alass will attempt alignment assuming the presence of commercial breaks or added/removed scenes. Disabling split_mode can make syncing faster but will only correct subtitles whose misalignment is the result of a constant shift.

  • split_penalty: Determines how eager the algorithm is to avoid splitting of the subtitles. A value of 1000 means that all lines will be shifted by the same offset, while 0.01 will produce MANY segments with different offsets. Values from 1 to 20 are the most reasonable.

  • speed_optimization: Greatly speeds up synchronization by sacrificing accuracy.

  • framerate_correction: Whether to attempt correction of mismatched framerates.

Fields§

§interval: i64§split_mode: bool§split_penalty: f64§speed_optimization: Option<f64>§framerate_correction: bool

Trait Implementations§

Source§

impl Default for SyncOptions

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.