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
.
FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of video and audio files.
ffmpeg -f concat -i mylist.txt -c copy output.mp4 This process is a way of concatenating the files and not re-encoding. Hence, it should be done speedily & conveniently. If there is no error message, you are sure to receive a final merged video named by 'output. mp4' in the MP4 folder.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With