Capturing video on android

Hello,
I’m trying to capture my scene to a video file using the advanced way explained at: https://wiki.jmonkeyengine.org/jme3/advanced/capture_audio_video_to_a_file.html

Problem that it uses some dependencies which does not work\exists in Android - javax.imageio
I would like to be able to capture my scenes as mp4 video - what is the best practice for doing so?

Thank you,
Adi

Is there a 3rd party android screen recorder app you can use like Fraps for PC?

One would hope the overheads would be very low due to heavy task specific optimizations.

external recording application is not good for me. I have built my own jMonkey based product (www.scenemax3d.com) and I need to be able to export the scene as mp4 video. I was hoping that there will be some kind of support in the engine for doing so but the “advanced” way is not working in Android

Ok. Well usually recording gameplay is the problem of a third party application. It is not unheard of that some games do record, but it may not be actual video - but more of a replay of events. Is this a possibility instead? For all intent it would act as a video and be played inside the application.

my application is not a game… it’s an animation computer programming language for young children. I need to be able to export the scene as a mp4 to enable kids share their animations on YouTube channels and such.
It’s a must feature…

the minimum android version to screen record is 5.0 else you will need to root the device. otherwise, it’s not possible.
https://developer.android.com/about/versions/android-5.0#ScreenCapture

Recording the screen is probably not the way to go anyway because then in order to export it the user needs to sit through the whole animation again and is unable to do anything else while its happening. Meanwhile, any lag and notifications will ruin the recording.

Assuming there is indeed no way to get the example working on android but it is possible on the pc. maybe a companion program on the computer that is able to export the animations?

Alternatively you can setup a server that is able to take in the data from the animation and create .mp4 files. If you do this you could use this to directly have a place to share animations meaning that users can just click a “share” button and their animation gets uploaded to your server for all to see. Which seems a lot easier than to click “export” then go to youtube, find the animation and upload it.

I’m not certain of the license restrictions and fees, either. I do know that they are patented (.mp3 and .mp4) tech and would require some kind of license, but I have no idea about cost, implications or restrictions. Maybe someone better versed in this area can shed some light, but it’s probably something you want to look at first before you invest heavily in any format.

1 Like

Moving the export to video logic to the cloud will make the solution much more complex and resource dependent. I will not be able to keep it free in that case. I would like to maintain it 100% mobile solution.

There must be a way to record a GL surface view. I’m willing to pay for a good library if anyone knows about one. Thanks for the answers so far :slight_smile:

If you know of other apps/tools that have this feature then you might try contacting them to see what solution they used.

If you can’t find any other apps/tools that have this feature then it may be an indicator that it is either super hard or not possible.

meh you don’t need any library this future already exists
https://developer.android.com/reference/android/media/MediaRecorder
if you want to use use a lib which you won’t need :stuck_out_tongue:

Do you have any idea how to use it with jMonkey rendering?
Grafika’s code is hard to understand and doesnt use GLSurfaceView nor MediaRecorder

the idea was to use the built in api in android grafika is for android <5
your app’s min android version is 6 use the built in functions

I searched a lot and didn’t find a sample code for binding a current GLSurfaceView to a MediaRecorder (If you have such code I’ll be glad to try it out).
Now I found an interesting article about “Recordable surface view” which can replace an existing GLSurfaceView so I’m going to try using it for my application.

Here is the article: https://withintent.uncorkedstudios.com/recording-screen-video-on-android-with-recordablesurfaceview-451c9daa213e