KOTLIN MULTIPLATFORM · PRE-ALPHA

filmstrip

A Kotlin Multiplatform library for editing, encoding and previewing video. Build a composition, preview it in the player, then export it to a file.

  • ANDROID
  • IOS
  • MACOS
  • JVM
  • BROWSER
implementation("dev.jordond.filmstrip:filmstrip:0.1.0-SNAPSHOT")

Quick start

One composition. Export it or play it.

  1. 01

    DESCRIBE THE EDIT

    Trim a clip and stack effects on it. It's plain data, so the player and export take the same one.

    1. 02

      ASK BEFORE YOU DECODE

      Find out what this device can do before anything decodes.

    2. 03

      EXPORT AS A FLOW

      Progress and results arrive as a flow. Cancel the scope to cancel.

val composition =
  compositionOf {
    clip(MediaSource.of("beach.mp4")) {
      trim(2.seconds..8.seconds)
      effects {
        saturation(2f)
        contrast(1.15f)
        textOverlay(
          text = "SUMMER '96",
          at = 0.seconds..3.seconds,
          anchor = Anchor.TopCenter,
          animation = fade(inDuration = 500.milliseconds),
        )
      }
      fadeOut(1.seconds)
    }
  }
val filmstrip = Filmstrip { allBackends() }

val plan =
  when (val verdict = filmstrip.plan(composition, ExportSpec.Upload)) {
    is Verdict.Capable -> verdict.plan
    is Verdict.Degraded -> verdict.plan
    is Verdict.Incapable -> return
  }

filmstrip.export(plan, MediaSink.temporary()).collect { status ->
  if (status is ExportStatus.Progress) println(status.fraction)
}

Try it

EDITIMPORT beach.mp400:00:00:00
RAWSUMMER '96
ABOUT 13 MB DOWNLOAD · STARTS WHEN YOU PRESS LOAD
beach.mp4
GRADE
TEXT

Want the whole thing? Open the full sample app.

Platforms

Every platform gets a backend built on its own video APIs. The same composition previews and exports on each of them.