Compiling VPlayer - matthewn4444/VPlayer_lib GitHub Wiki
Include in Project as Module
-
First clone this project in the root of your project
https://github.com/matthewn4444/VPlayer_lib.git -
Edit your project's settings.gradle and add these two lines at the bottom
include ':VPlayer_library' project(':VPlayer_library').projectDir = new File(settingsDir, 'VPlayer_lib/VPlayer_library')Note that the settingsDir should point relative path to VPlayer_library folder
-
Edit your application's build.gradle file to add the dependency by adding this:
dependencies { ... compile project(':VPlayer_library') ... } -
After synchronizing your project, follow the below instructions to resolve the errors related to this project in Android Studio
Compilation Methods
There are two ways to compile the VPlayer library, This is the order of increasing difficulty.
-
[NDK Knowledge] Download FFmpeg binaries (and compile VPlayer NDK and Java code)
This way allows you to edit the VPlayer NDK code without touching FFmpeg.
-
[NDK Knowledge | Harder] Compile FFmpeg from scratch (then build VPlayer NDK, finally Java)
This way allows you to change FFmpeg codecs and binary size as well as the VPlayer NDK code.
Building VPlayer
Building VPlayer with FFmpeg binaries
Note that current state of the build below binaries will not work.
-
Download the binaries here (v0.3.2) or without subtitles here
-
Get the dependencies: tropicssl, ffmpeg (headers only) and libyuv (DO ONE of the following):
- Unzip and extract the dependencies from root folder (this should add folders to VPlayer_library/jni/)
- OR Run the script /{root}/VPlayer_lib/VPlayer_library/jni/setup.sh.
Your folder structure should look like this under /jni
jni/ |- android-ndk-profiler-3.1/ |- application/ |- ffmpeg/ |- ffmpeg-build/ |- libyuv/ |- tropicssl/ |- Android.mk |- Android-tropicssl.mk |- Application.mk |- setup.sh -
[Optional] Edit the Application.mk to change architectures
-
[Optional] Edit the Android.mk:
- FEATURE_NEON: if you comment this, you need to remove NativeTester code in VPlayerController.java@LINE292
- SUBTITLES: remove if you do not want subtitle support; if you download the binaries without subtitles you must comment this out
- MODULE_ENCRYPT: remove if you do not want encryption for networking
- LIBRARY_PROFILER: remove if you do not want the profiler
-
Import this project into Android Studio.
-
Once imported, it will ask you to locate NDK folder, you must do that
-
Wait for it to build or start the build yourself from the menu and it will build VPlayerExample.apk
Building from scratch (Hard method)
Building from scratch allows you to customize FFmpeg for the price of time. You can reduce the file size of the shared library of libFFmpeg.so or add more codecs for the videos.
-
Build and configure FFmpeg. Once finished the shared libraries would be in jni/ffmpeg-build
-
Follow the instructions from Building VPlayer with FFmpeg binaries starting from step 2.