I'm looking at the class MediaRecorder of the Android SDK, and I was wondering if it can be used to record a video made from a Surface. Example: I want to record what I display on my surface (a video game?) into a file. As I said in the title: I'm not looking to record anything from the camera.
I think it is possible by overriding most of the class, but I'd very much like some ideas... Beside, I'm not sure how the Camera class is used in MediaRecorder, and what I should get from my Surface to replace it.
Thank you for your interest!
PS: I'm looking at the native code used my MediaRecorder to have some clue, maybe it will inspire someone else: http://www.netmite.com/android/mydroid/frameworks/base/media/jni/
The MediaRecorder API enables you to record audio and video from a web app. It's available now in Firefox and in Chrome for Android and desktop.
MediaRecorder class can be used to record audio and video files. After recording the media, we can create a sound file that can be played later. In this example, we are going to record the audio file and storing it in the external directory in 3gp format.
Media Recorder records both audio and video recordings and save them into many different formats of your liking with just a few simple taps! All recordings will automatically appear on the Files app.
The ability to record from a Surface was added in Android Lollipop. Here is the documentation:
http://developer.android.com/about/versions/android-5.0.html#ScreenCapture
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With