0

I am working on an app for android that creates video file from a video at start and then set of images, and saves it. Is there any way to accomplish that?

I tried JCodec and it has broken libraries, untrusted code on the web and lack of knowledge about this library.

I tried FFMpeg and it is unsupported enough on android and involves working with NDK.

I tried to create an animation with AnimationDrawable and save this animation as a video, but I can't find a way to save animation as video except using the feature of KITKAT 4.4, but it requires connecting to a computer and having a root.

Is there any other solutions or a trusted and explained way to do this using the ways above?

Thank in advance

  • 1
    If you can render it with GLES, you can record a .mp4 video using MediaCodec and MediaMuxer. Requires API 18+. Some examples on http://bigflake.com/mediacodec/ and https://github.com/google/grafika . – fadden May 18 '14 at 17:05
  • @fadden: what's special about GLES in the solution you propose? – Alex Cohn May 18 '14 at 20:06
  • It's used to provide Surface input to MediaCodec. You can't do that with software rendering on a Canvas (https://code.google.com/p/android/issues/detail?id=61194). I agree with your answer -- ffmpeg is a better choice unless you only care about API 18+. – fadden May 19 '14 at 03:00
  • @fadden: if you use MediaMuxer to simply write to a local mp4 file, you cam later play this file anywhere. – Alex Cohn May 20 '14 at 15:53

1 Answers1

0

I would vote for FFMPEG. You don't need NDK or other sourcery if you can afford a prebuilt solution, like FFmpeg 4 Android.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307