[][src]Function alass_util::sync

pub fn sync(
    sub_path_in: &str,
    sub_path_out: &str,
    ref_spans: &TimeSpans,
    ref_fps: f64,
    sub_encoding: Option<String>,
    opt: &SyncOptions
) -> Result<(), SyncError>

Reads and parses an input subtitle file, synchronizes it with the given reference timespans using the alass crate, and writes the corrected subtitles back to disk.

  • sub_path_in: Path to the incorrect subtitle file.

  • sub_path_out: Path to which the synchronized subtitle file shall be written (must include filename).

  • ref_spans: Reference timespans to use for alignment.

  • ref_fps: Framerate of the reference video file (used for framerate correction).

  • sub_encoding: The IANA charset encoding of the subtitle file. If 'auto' is given (or if not specified), an attempt is made to guess the correct encoding based on the contents of the file.

  • options: Parameters governing various aspects of the synchronization process. See SyncOptions or alass documentation for details.