Filmstrip

Probes, plans, exports, previews and renders frames of an edit.

One instance per component graph: injectable, disposable, and created by the Filmstrip factory function. Implemented by filmstrip, never by a consumer.

probe asks what a file is, capabilities asks what the device can encode, plan asks what this device will do with an edit, and export, preview and frame do the work, all three over the same EditComposition value, built with dev.jordond.filmstrip.edit.compositionOf.

The last two are what FrameRenderer and PreviewFactory declare, so a component that only draws frames or only plays takes one of those and is handed this.

Which of these work depends on what is registered. export, plan and capabilities need this target's engine artifact, which is filmstrip-transform-media3, filmstrip-transform-avfoundation, filmstrip-transform-webcodecs or filmstrip-transform-ffmpeg. preview and effect-applied frames need filmstrip-player, and effects need filmstrip-effects. Each registers itself through FilmstripBuilder, or dev.jordond.filmstrip:filmstrip with allBackends() registers the engine and the player together. A missing one is reported as FilmstripError.BackendMissing naming the artifact rather than as a crash.

Properties

Link copied to clipboard

Everything this instance was built with, for diagnostics.

Functions

Link copied to clipboard
abstract suspend fun capabilities(): CapabilitiesResult

Asks what this device's hardware encoders can do. Cached per process.

Link copied to clipboard
abstract fun export(plan: ExportPlan, to: MediaSink): Flow<ExportStatus>

Runs a plan.

abstract fun export(composition: EditComposition, spec: ExportSpec, to: MediaSink): Flow<ExportStatus>

Plans and exports in one call.

Link copied to clipboard
abstract suspend fun frame(composition: EditComposition, at: Duration, heightPx: Int? = null, exportSpec: ExportSpec = ExportSpec()): FrameResult

Renders one frame of a composition, with its effects applied.

Link copied to clipboard
suspend fun FrameRenderer.frame(source: MediaSource, at: Duration, heightPx: Int? = null): FrameResult

Renders one frame of a single source, with no composition to build by hand.

Link copied to clipboard
abstract fun frames(composition: EditComposition, at: List<Duration>, heightPx: Int? = null, exportSpec: ExportSpec = ExportSpec()): Flow<FrameResult>

Renders several frames, emitting each as it is ready.

Link copied to clipboard
abstract fun parityOf(specId: String): EffectParity?

How faithfully an effect will be previewed, with no work at all.

Link copied to clipboard
abstract suspend fun plan(composition: EditComposition, spec: ExportSpec): Verdict

Resolves every effect and validates the pipeline against this device, without decoding, encoding or writing anything.

Link copied to clipboard
abstract fun preview(composition: EditComposition, config: PlayerConfig = PlayerConfig()): VideoPlayer

Opens a player over the same composition value that an export takes.

Link copied to clipboard
abstract suspend fun probe(source: MediaSource): ProbeResult

Reads a source's metadata without decoding it.

Link copied to clipboard
suspend fun FrameRenderer.still(composition: EditComposition, at: Duration, to: MediaSink, spec: StillSpec = StillSpec()): StillResult

Renders one frame of a composition and writes it as a still image.

suspend fun FrameRenderer.still(source: MediaSource, at: Duration, to: MediaSink, spec: StillSpec = StillSpec()): StillResult

Encodes one frame of a single source as a still image, with no composition to build by hand.