Solution to the failure of ijkplayer to play MKV format video based on Android

Write in front

The ijkplayer obtained by directly referencing or compiling the source code in the project has a (- 10000) error when playing MKV files. Go to the project GitHub to check it. By default, it does not support the playback of videos in MKV and RMVB formats.

It took a day to solve the problem (why did it take a day, because I was stupid). Here is a record of the solution (the official has actually had a detailed tutorial, but I didn't take it seriously at that time.) here is a record for myself, a novice:

It is still introduced by compiling the source code, but the script file needs to be changed according to the official method

Official address of ijkplayer: https://github.com/Bilibili/ijkplayer

Running system: Mac OS

Step 1: install homebrew, GIT, yam and NDK

There are many online tutorials, or I won't write it....

Don't use 15 for the NDK version. You can go to the next 14 version on the Internet, otherwise there may be compilation errors.

The second step is to pull down the source code

Enter the following commands in the terminal:

Step 3: modify the script file used to compile ffmpeg

This is the main place. In fact, the official has written it

Step 4 compile the source code

Step 5 add the corresponding so library and reference to the project

After compilation, we can see the ijkplayer folders corresponding to different architectures in the ijkplayer Android / Android / ijkplayer folder

First, import the project into Android studio and run it. Import must be done, otherwise it will not be generated

Ijkplayer-java-release.aar file

The import operation is as follows:

Then copy the folder containing so files corresponding to our required architecture (for example, x86 folder under ijkplayer-x86 / SRC / main / LIBS /) and ijkplayer-java-release.aar file (under ijkplayer-java / build / output / AAR folder) to our project LIBS directory

Then add it in the build. Gradle file

That's it. Just use it. There are many online tutorials on how to use it. I won't talk about it.......

The above solution of introducing ijkplayer based on Android and unable to play MKV format video is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>