GithubHelp home page GithubHelp logo

rogererill / lottierecordertest Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 12.0 138 KB

Sample project to demonstrate how to transform a Lottie animation into a mp4 video. From https://engineering.21buttons.com/how-to-generate-videos-using-lottie-in-android-2db6ecceb2a

Kotlin 100.00%

lottierecordertest's People

Contributors

rogererill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lottierecordertest's Issues

How can I set what background to use, as MP4 doesn't seem to support transparent background color for it?

Currently it paints the background black...

I tried to change the "Recorder.nextFrame" function, to set as a red background for example, and it didn't change it:

    fun nextFrame(currentFrame: Drawable) {
        drainEncoder(false)
        val canvas = inputSurface.lockCanvas(null)
        try {
            canvas.drawColor(0xffff0000.toInt(), PorterDuff.Mode.CLEAR)  // Here you need to set some kind of background. Could be any color
            currentFrame.draw(canvas)
        } finally {
            inputSurface.unlockCanvasAndPost(canvas)
        }
    }

How to Reocrd Video on Backgroudn Thread or in Service?

First of all thansk for this project it helps alot. but i am stuck at one point when i record lottie animation as video . it doing on main thread so sometimes we got ANR issue. how can we use this recorder on backgroudn thread or in service?

Does it support json and images output from BodyMovin

Dear Roger,
Thanks so much for great repo. I have not only .json output from BodyMovin, but also images folder output, which contains several .png as well. When I try the ZIP folder way or put images under /asset folder way as Lottie officially suggests, the app won't work properly.
I'm wondering whether this is supported by this project? If not, will this be on your plan to implement this or give any suggestions?

Thanks

How to draw bitmap over already drawn canvas

        val canvas = inputSurface.lockCanvas(null)
        try {
            val source = Rect(200, 200, 400, 400)
            canvas.drawBitmap(watermark, null, source, null)
         
            currentFrame.draw(canvas)
        } finally {
            inputSurface.unlockCanvasAndPost(canvas)
        } 

Here i am trying to draw bitmap(watermark) over canvas created from Surface. But bitmap(watermark) draws below the canvas created from Surface. How can i draw watermark on top? Not in background.

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.