Code Monkey home page Code Monkey logo

compose-movie-maker's Introduction

Compose Movie Maker

Could it be possible to create a MP4 video if you only use Jetpack Compose?

This idea is heavily inspired from Remotion by Jonny Burger, "build a framework for creating videos programmatically using React".

By doing it you can prepare/code templates of videos and make them configurable, so you don't have to re-do the entire video montage every you want to adjust a text or animation.

Compose Movie Maker Example

How-to

Scene 1

BigTitle(
    title = { modifier ->
        Text(
            modifier = modifier.padding(16.dp),
            text = "Inspired\nby Remotion",
            style = MaterialTheme.typography.h1,
            fontWeight = FontWeight.Bold
        )
    }
)

Scene 2

Headline(
    title = "100% Jetpack Compose",
    millisToShowFullLength = 2_000L
)

Scene 3

AvatarTitleSubTitle(
    image = { modifier ->
        Image(
            modifier = modifier.clip(CircleShape),
            painter = painterResource("avatar.png"),
            contentScale = ContentScale.Crop,
            contentDescription = null
        )
    },
    title = { modifier ->
        Text("Olivier PEREZ", modifier = modifier, style = MaterialTheme.typography.h3)
    },
    subTitle = { modifier ->
        Text(
            "Compose Movie Maker : le 7ème art à portée de composants web et d'API \uD83C\uDFAC ",
            modifier = modifier,
            style = MaterialTheme.typography.h5
        )
    }
)

Assemble the whole to record it

RecorderBox(
    fps = 30,
    dimension = Dimension(1200, 675),
    modifier = Modifier.fillMaxSize()
) {
    BigTitle(
        modifier = Modifier.scene(2_000L),
        // ...
    )
    Headline(
        modifier = Modifier.scene(4_000L),
        // ...
    )
    AvatarTitleSubTitle(
        modifier = Modifier.scene(2_000L),
        // ...
    )
}

UI Example

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.