Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK. How to play video.

I need to play video on Android device (different formats). As I have understand, the best way is to use Android NDK with specific libraries that can play video. I have done some basic examples to understand NDK usage, but I don't know what to do next. As I have understood, I must install ffmpeg first of all. So I have the following questions given below:

  1. I need to have ffmpeg (the best way is to use Linux, not Windows, because in Windows there are some troubles with its installation).
  2. How to play sound of video?
  3. I have read that some open-source libraries can play video without any efforts. My job is to give them byte-array or path to video on SD. Is this right?

So, can anyone help me and explain basic ways how to play video with ndk, may be some basic plan or links? Thank you very much for interest to my question!

like image 319
bukka.wh Avatar asked Mar 22 '23 01:03

bukka.wh


1 Answers

Ok firstly starting with your problem; you have to decide whether you want Manipulate Video or just Play video. If you are just playing video/audio then there is no need for external lib. like Ffmpeg.

But if you are manipulating audio/video then go for Ffmpeg. Then decide whether you want a ready compiled Ffmpeg library or want to pursue for Compile via NDK with custom flag settings.

If you can do with ready Ffmpeg lib. then you can use this App and help for integrating it at here.

But if you are going for making the *.so or compile Ffmpeg on your own via ndk then see these Stackoverflow Help on FFmpeg for Android. Here you can have your own settings. You also can use the Precompiled lib. of Ffmpeg directly which is available at Github/Roman10

Now for your questions:-

  1. As above

  2. Depends whether you are extracting then Ffmpeg Doc1 or just playing sound then Stackoverflow link

  3. Play simply by looking at Android Docs,Video

Cheers..!

like image 135
BlueSword Avatar answered Mar 27 '23 21:03

BlueSword