Use FFMPEG on Android

Does anyone know how to use FFMPEG on Android to convert a YUV420 frame to H.264?

I ported FFMPEG to Android with the NDK, I just don’t know how to use it. Source code is evaluated.

+4
source share
1 answer

You have two options:

  • use ffmpeg api - google ffmpeg sample code. it requires a good understanding of the api and is very comprehnsive.
  • compile ffmpeg.c and call it main () via jni. This requires that you understand the command line options. It is rather cumbersome but works.

    You need to keep an eye on the static vars defined in ffmpeg.c and reset each time the main function is called. Also make sure that you do not call the main thing in two threads at the same time.

+7
source

Source: https://habr.com/ru/post/1341934/


All Articles