Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It really depends on the way you implement your "pet view". Are you drawing on a Canvas? OpenGl ES? Normal Android view hierarchy?</p> <p>Anyway, there is no magical "recordScreenToVideo()" like one of the comments said.</p> <p>You need to:</p> <ul> <li><p>Obtain bitmaps representing your "frames". This depends on how you implement your view. If you draw yourself (Canvas or OpenGL), then save your raw pixel buffers as frames. If you use the normal view hierarchy, subclass Android's onDraw and save the "frames" that you get on the canvas. The frequency of the system's call to onDraw will be no less than the actual "framerate" of the screen. If needed, duplicate frames afterwards to supply a 15fps video.</p></li> <li><p>Encode your frames. Seems like you already have a mechanism to do that, you just need it to be more efficient.</p></li> </ul> <p>Ways you can optimize encoding:</p> <ul> <li>Cache your bitmaps (frames) and encode afterwards. This will work only if your expected video will be relatively short, otherwise you'll get out of storage.</li> <li>Record only at the framerate that your app actually generates (depending on the way you draw) and use an encoder parameter to generate a 15fps video (without actually supplying 15 frames per second).</li> <li>Adjust quality settings to current device. Can be done by performing a hidden CPU cycle test on app startup and defining some thresholds.</li> <li>Encode only the most relevant portion of the screen.</li> <li>Again, really depending on the way you implement - if you can save some "history data", and then convert that to frames without having to do it in real time, that would be best. For example, "move", "smile", "change color" - or whatever your business logic is, since you didn't elaborate on that. Your "generate movie" function will animate this history data as a frame sequence (without drawing to the screen) and then encode.</li> </ul> <p>Hope that helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload