← back to roto on ba3a.dev

WebpEncoder

Writes a lossless animated WebP through ffmpeg, run by runner: the prepared frames go to a temporary folder as PNG, with a concat list giving their durations, and WebpTiming corrects the one duration ffmpeg gets wrong. ffmpeg merges identical neighbouring frames, adding their durations, and writes a still picture when all frames are identical.

The same input gives the same bytes with one ffmpeg version. A missing or incapable ffmpeg fails with a com.roto.core.video.VideoToolException; Ffmpeg.webpUnavailable tells beforehand.

Constructors

Link copied to clipboard
constructor(runner: ProcessRunner)

Functions

Link copied to clipboard
open override fun encode(frames: ExportFrames, options: AnimationOptions): ByteArray

The file holding frames, prepared as options ask.