4

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!

Balu
  • 1,069
  • 2
  • 10
  • 24
bukka.wh
  • 913
  • 2
  • 16
  • 29

1 Answers1

7

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..!

Community
  • 1
  • 1
BlueSword
  • 1,290
  • 12
  • 25
  • Jay, thank You very much! Your answer helps me to imagin a basic way what to do. But I need to clarify some moments. I apologize for the possible illiterate questions :-))ю – bukka.wh Jan 08 '14 at 09:39
  • Jay, I am sorry, there was a bug with comments, I need some clarification. Yes, I need manipulation with my video files and I need to compile Ffmpeg with my app. As I understood, ffmpeg is a package of libraries so it can work with different video formats (but I didn't find *.smk, *.riff and some others in ffmpeg documentation)? And the other one question: ffmpeg can play video or only decode it from one format to other? THANKS!!! – bukka.wh Jan 08 '14 at 09:50
  • @user1885632 Regarding `ques.1`:i have not heard or used these extension in `Ffmpeg` so srry google yourself; `ques.2`:yes you can both decode and convert from one form to other. Do accept answer if useful.Cheers. – BlueSword Jan 08 '14 at 09:53
  • Thanks, Jay! And may I ask you the last question :-) So, basic plan is 1. Get ffmpeg. 2. Compile Ffmpeg. 3. Get video, then ffmpeg will decode it and play. Am I right? – bukka.wh Jan 08 '14 at 10:12
  • @user1885632 for `1. and 2.`decide from `2` and `3` paragraph from answer; remaining great..!! – BlueSword Jan 08 '14 at 10:16
  • 1
    How would you do playback from jni? – Jacob Phillips Oct 23 '15 at 07:02