← back to roto on ba3a.dev

FrameExtractor

class FrameExtractor(ffmpeg: Ffmpeg, cache: StageCache)

The first pipeline stage: a range of a source video, or a photo, as frames at a working height. The frames are cached under the source's content, the range and frame rate if any, the height and the ffmpeg version, so trimming again or upgrading ffmpeg extracts again and nothing else does.

Constructors

Link copied to clipboard
constructor(ffmpeg: Ffmpeg, cache: StageCache)

Types

Link copied to clipboard
object Companion

The stage names and the working height.

Functions

Link copied to clipboard
fun frames(source: Path, range: TimeRange, frameRate: FrameRate, height: Int = WORKING_HEIGHT): StageOutput<List<Raster>>

range of source as frames at an even frameRate, each height pixels tall.

Link copied to clipboard
fun still(source: Path, height: Int = WORKING_HEIGHT): StageOutput<List<Raster>>

The photo source as a single frame height pixels tall. ffmpeg decodes it as it does a video, upright and through the same scaling, so everything after this stage is the same.