Question

Is it possible to build screenrecord binary to run on 4.2 , or are there too many missing apis ? Can I workaround changed apis and libraries ? because as far as I understand the main parts exist in 4.2 ( like mediacodec ) . I dont need the muxer I can use my own muxing for 4.2.

Was it helpful?

Solution

It will be difficult.

screenrecord shipped in Android 4.4, but except for one minor API (to tear down the virtual display) everything it needs is present in Android 4.3.

Android 4.2 lacks some important things. The MediaMuxer class didn't exist, and MediaCodec didn't yet have the createInputSurface() call. As you noted it's not hard to work around the former, but for the latter you either have to feed MediaCodec raw YUV buffers (which is difficult to do pre-4.3, and will reduce your frame rate), or (since screenrecord is using private internal APIs already) interface directly with libstagefright to implement your own "metadata mode" handling.

I'm not sure offhand what the state of virtual displays was in 4.2, but you'd also need those to work fully.

Companies like Kamcord and Everyplay advertise that they can do game recording back to Android 4.1, but I suspect they're recording the OpenGL ES rendering (rather than virtual display output) and doing a lot of internal plumbing themselves.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top