Is there any way to port ffmpeg command to Android

2019-04-17 05:49发布

问题:

This link http://www.roman10.net/how-to-port-ffmpeg-the-program-to-androidideas-and-thoughts/ talks about port ffmpeg command to Android.

Can anyone describe more detail?

My purpose is to record user's behavior on Android device and save as video file which contains user's sound.

回答1:

Build FFMPEG for android as a shard library and using Android NDK use this in your android application, for this you don't need a root permission on device. It works like other buils library.

Look at this SO Question FFMPEG on Android



回答2:

FB file /dev/graphics/fb0 is owned by root and group is set to graphics. Since regular android apps do not belong to the graphics group, they cannot read it.

To fix this you could make a native application (not a JNI one, but a native executable) that uses the ffmpeg libraries (statically), and get it installed via ADB using $adb push command. This binary will be owned by the 'shell' id but it will belong to the graphics group. And so this will have access to read the FB directly.

You could code your Java app to talk to this binary (via say sockets) and control things from it. ASL (Android Screenshot Library) does something similar but does not use ffmpeg but captures screen shots directly. Refer to http://code.google.com/p/android-screenshot-library/