17

I was able to build ffmpeg library by using rock player build script.

Now I have this .so file, how do I play video? And I want to display this video inside a small LinearLayout in my Activity.

Is it possible?

Update: I know that it's easy to play video using VideoView or MediaPlayer + SurfaceView. I just wanted to understand more about ffmpeg library and how to display the frames inside an Android Activity.

HitOdessit
  • 7,198
  • 4
  • 36
  • 59
Macchiato
  • 825
  • 1
  • 11
  • 24

3 Answers3

2

Have a look at this player: https://github.com/bbcallen/ijkplayer

Basically what you need to do is build a JNI interface through to the MediaPlayer class (or possibly ExoPlayer in newer Android though I haven't done this yet).

If you look at the repo link you will see that this needs to be done on top of ffplay more than ffmpeg as the former is the player and the latter the decode/encode/package tool.

Andrew
  • 742
  • 8
  • 21
  • Working, but uses software decoding in my case - but much better than VideoView for RTP stream stability wise. – benchuk Jun 03 '15 at 20:12
0

There are a few ways of doing this. You should have a look at Dolphin Player, an open source media player for Android. Its actually rather complex, you could also look at the VLC source code which makes use of FFMPEG but VLC is an extensive very complete wrapper to play videos.

Kevin Parker
  • 16,975
  • 20
  • 76
  • 105
0

See for example an Android app in github: https://github.com/havlenapetr/FFMpeg. This project may be somewhat outdated, but its part that is responsible for video display is quite understandable. You can look for more recent contributions on github.

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