Compiling video support - matthewn4444/onscripter-plus-android GitHub Wiki
Since version 1.1.10, video has been added for games that uses them (such as secret game).
This uses FFmpeg for Android as a base. The library is here which was forked from AndroidFFmpeg. You can read the enhancements and how to build there.
For ONScripter Plus, I have trimmed the FFmpeg to run only MPEG and AVI files (MPEG1,2,3,4 video and MP2 and MP3 audio) and H264 mp4 support for Lovely Quest. Usually FFmpeg for Android is over 30mb large (packed 3.5mb in the APK), limiting the codecs, this project now compiles binaries to about 2mb.
The following will show you how to build the video specifically for ONScripter Plus.
Adding VPlayer_lib and compiling with it
-
Once you clone/pull ONScripter Plus, you need to initialize the submodules. Type the following in command line (do not use recursive or it will download other unwanted libraries as well!)
cd onscripter-plus-android git submodule update --init --recursive
-
Import project to Eclipse and make sure that ONScripter Plus project has VPlayer_lib as a project (you do not need to import VPlayerExample)
-
Give VPlayer_lib native support (right-click VPlayer_lib > Android Tools > Add Native Support)
-
Download the prebuilt libraries and extract it on root (matching the folder names).
-
Get the ffmpeg headers by 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
-
Edit the Android.mk and remove/comment the lines
SUBTITLES:=yes MODULE_ENCRYPT:=yes
-
Build the entire project or just build VPlayer_lib or use command line and use
ndk-build
.
Modifying FFmpeg
If you like to change the codecs or anything else you can edit the build_android.sh file inside the ffmpeg_build folder from root. For more information on building and customizing FFmpeg please refer here.