MRFFToolChain Build Shell [中文版]
MRFFToolChain cross-compiles FFmpeg (4.x–8.x) and 25+ third-party libraries — ass, dav1d, x264, x265, openssl, bluray, and more — for iOS, macOS, tvOS, Android, and HarmonyOS, then publishes the pre-built binaries to GitHub Releases. Stop fighting cross-compilation: download a ready-made library and link it in one command.
It powers fsplayer, ijkplayer, and FFmpegTutorial.
Libraries included: ass、bluray、dav1d、dovi、dvdread、dvdnav、ffmpeg、freetype、fribidi、harfbuzz、lcms2、placebo、moltenvk、openssl、opus、shaderc、smb2、soundtouch、unibreak、uavs3d、xml2、yuv、webp、x264、x265.
| platform | architectures | minimum deployment target |
|---|---|---|
| iOS | arm64、arm64_simulator、x86_64_simulator | 12.0 |
| tvOS | arm64、arm64_simulator、x86_64_simulator | 12.0 |
| macOS | arm64、x86_64 | 10.14 |
| Android | arm64、armv7a、x86_64、x86 | 5.0 (API 21) |
| HarmonyOS | arm64、x86_64 | 5.0.0 (API 12) |
- FFmpeg 8.1.2 is ready
- HarmonyOS support includes pre-built libass and its font/text dependencies
- Upgraded all libraries to latest, with improved optimizations
- Built with macOS 26 and Xcode 26.6
- Android supports 16 KB memory page sizes
Save yourself a great deal of time by directly downloading the pre-compiled libraries from GitHub. These pre-compiled libraries already applied patches which in the patches directory.
#Check the help first ./main.sh install --help # Examples of usage: ./main.sh install -p macos -l ffmpeg ./main.sh install -p ios -l 'ass ffmpeg' ./main.sh install -p android -l openssl3 ./main.sh install -p ohos -l "ass ffmpeg8"
Don't waste your time compiling these libraries unless you've modified the source code!
The script parameters are flexible and can be combined as needed. Here are some common examples:
# Check the help first
./main.sh init --help
# Prepare libass source code for the iOS platform
./main.sh init -p ios -l ass
# Prepare ffmpeg7 source code for the x86 architecture on iOS
./main.sh init -p ios -l ffmpeg7 -a x86_64_simulator
# Prepare source code for specific libraries for the Android platform
./main.sh init -p android -l "openssl ffmpeg"
# Prepare ffmpeg8 source code for the HarmonyOS platform
./main.sh init -p ohos -l ffmpeg8
Once the source code repository initialization is complete, you can start the compilation process.
# Check the help first
./main.sh compile --help
# As shown in the help:
# -p specifies the platform
# -c specifies the action (e.g build for compilation, rebuild for recompilation)
# -l specifies the libraries to compile
# -a specifies the CPU architecture
The following code demonstrates how to compile FFmpeg 7 for the iOS platform:
# install FFmpeg7's dependencies has two choices
# recommend choice (because ffmpeg7 was pre-compiled,it contained all dependencies)
./main.sh install -p ios -l ffmpeg7
# other choice (you must know ffmpeg7's dependent lib name)
./main.sh install -p ios -l "openssl3 opus bluray dav1d dvdnav uavs3d smb2"
# Compile FFmpeg7 for the arm64 architecture on iOS with xcframework
./main.sh compile -p ios -a arm64 -l ffmpeg7 --fmwk
The order of these parameters does not matter; they can be arranged in any sequence.
Current version and repository URLs of each library:
| Lib Name | Current Version | Repository URL | Mirror Repository URL |
|---|---|---|---|
| ffmpeg8 | 8.1.2 | https://github.com/FFmpeg/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ffmpeg7 | 7.1.3 | https://github.com/FFmpeg/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ffmpeg6 | 6.1.1 | https://github.com/FFmpeg/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ffmpeg5 | 5.1.6 | https://github.com/FFmpeg/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ffmpeg4 | 4.0.5 | https://github.com/FFmpeg/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ijkffmpeg | ff4.0--ijk0.8.8--20210426--001 | https://github.com/bilibili/FFmpeg.git | export GIT_IJKFFMPEG_UPSTREAM=git@xx:yy/FFmpeg.git |
| ass | 0.17.5 | https://github.com/libass/libass.git | export GIT_ASS_UPSTREAM=git@xx:yy/libass.git |
| bluray | 1.3.4 | https://code.videolan.org/videolan/libbluray.git | export GIT_BLURAY_UPSTREAM=git@xx:yy/libbluray.git |
| dav1d | 1.5.4 | https://code.videolan.org/videolan/dav1d.git | export GIT_DAV1D_UPSTREAM=git@xx:yy/dav1d.git |
| dvdread | 7.1.1 | https://code.videolan.org/videolan/libdvdread.git | export GIT_DVDREAD_UPSTREAM=git@xx:yy/libdvdread.git |
| dvdnav | master-9831fe01 | https://code.videolan.org/videolan/libdvdnav.git | export GIT_DVDNAV_UPSTREAM=git@xx:yy/libdvdnav.git |
| fontconfig | 2.18.3 | https://gitlab.freedesktop.org/fontconfig/fontconfig.git | export GIT_FONTCONFIG_UPSTREAM=git@xx:yy/fontconfig.git |
| freetype | 2.14.3 | https://gitlab.freedesktop.org/freetype/freetype.git | export GIT_FREETYPE_UPSTREAM=git@xx:yy/freetype.git |
| fribidi | 1.0.16 | https://github.com/fribidi/fribidi.git | export GIT_FRIBIDI_UPSTREAM=git@xx:yy/fribidi.git |
| harfbuzz | 14.3.1 | https://github.com/harfbuzz/harfbuzz.git | export GIT_HARFBUZZ_UPSTREAM=git@xx:yy/harfbuzz.git |
| openssl | 1.1.1w | https://github.com/openssl/openssl.git | export GIT_OPENSSL_UPSTREAM=git@xx:yy/openssl.git |
| openssl3 | 3.5.9 | https://github.com/openssl/openssl.git | export GIT_OPENSSL_UPSTREAM=git@xx:yy/openssl.git |
| opus | 1.6.1 | https://gitlab.xiph.org/xiph/opus.git | export GIT_OPUS_UPSTREAM=git@xx:yy/opus.git |
| smb2 | 6.2 | https://github.com/sahlberg/libsmb2.git | export GIT_SMB2_UPSTREAM=git@xx:yy/libsmb2.git |
| soundtouch | 2.4.1 | https://codeberg.org/soundtouch/soundtouch.git | export GIT_SOUNDTOUCH_UPSTREAM=git@xx:yy/soundtouch.git |
| unibreak | 7.0 | https://github.com/adah1972/libunibreak.git | export GIT_UNIBREAK_UPSTREAM=git@xx:yy/libunibreak.git |
| uavs3d | 1.2.1 | https://github.com/uavs3/uavs3d.git | export GIT_UAVS3D_UPSTREAM=git@xx:yy/UAVS3D.git |
| xml2 | 2.15.3 | https://github.com/GNOME/libxml2.git | export GIT_FONTCONFIG_UPSTREAM=git@xx:yy/fontconfig.git |
| yuv | main-f94b8cf7 | https://github.com/debugly/libyuv.git | export GIT_YUV_UPSTREAM=git@xx:yy/yuv.git |
| webp | v1.6.0 | https://github.com/debugly/libwebp.git | export GIT_WEBP_UPSTREAM=git@xx:yy/webp.git |
| placebo | 7.360.1 | https://github.com/haasn/libplacebo.git | export GIT_LIBPLACEBO_UPSTREAM=git@xx:yy/libplacebo.git |
| shaderc | 2026.3 | https://github.com/google/shaderc.git | export GIT_SHADERC_UPSTREAM=git@xx:yy/shaderc.git |
| moltenvk | 1.4.2 | https://github.com/KhronosGroup/MoltenVK.git | export GIT_MOLTENVK_UPSTREAM=git@xx:yy/MoltenVK.git |
| lcms2 | 2.19 | https://github.com/mm2/Little-CMS.git | export GIT_LCMS2_UPSTREAM=git@xx:yy/Little-CMS.git |
| dovi | libdovi-3.4.0 | https://github.com/quietvoid/dovi_tool.git | export GIT_DOVI_UPSTREAM=git@xx:yy/libdovi.git |
| x264 | master | https://code.videolan.org/videolan/x264.git | export GIT_X264_UPSTREAM=git@xx:yy/x264.git |
| x265 | 4.2 | https://bitbucket.org/multicoreware/x265_git.git | export GIT_X265_UPSTREAM=git@xx:yy/x265.git |
- Fontconfig: xml2,freetype
- Bluray: xml2
- Harfbuzz: freetype
- Dvdnav: dvdread
- Placebo for macOS: shaderc,moltenvk,dovi,lcms2
- Ass for Apple: harfbuzz,fribidi,unibreak
- Ass for Android: harfbuzz,fribidi,unibreak,fontconfig
- Ass for HarmonyOS: harfbuzz,fribidi,unibreak,fontconfig
- IJKFFmpeg: openssl
- FFmpeg4 for Apple: openssl3,opus,bluray
- FFmpeg5 for Apple: openssl3,opus,bluray,dav1d,dvdread,uavs3d
- FFmpeg6 for Apple: openssl3,opus,bluray,dav1d,dvdread,uavs3d,smb2
- FFmpeg7 for Apple: openssl3,opus,bluray,dav1d,dvdnav,uavs3d,smb2,webp
- FFmpeg8 for Apple: openssl3,opus,bluray,dav1d,uavs3d,smb2,webp
- FFmpeg4 for Android: openssl3,opus,bluray,soundtouch
- FFmpeg5 for Android: openssl3,opus,bluray,dav1d,dvdread,uavs3d,soundtouch
- FFmpeg6 for Android: openssl3,opus,bluray,dav1d,dvdread,uavs3d,smb2,soundtouch
- FFmpeg7 for Android: openssl3,opus,bluray,dav1d,dvdnav,uavs3d,smb2,soundtouch
- FFmpeg8 for Android: openssl3,opus,bluray,dav1d,uavs3d,smb2,soundtouch
- FFmpeg8 for HarmonyOS: openssl3,opus,bluray,dav1d,uavs3d,smb2,soundtouch
- ffmpeg is not denpendent on ass and placebo.
- fsplayer is denpendent on ffmpeg and ass and placebo.
- ijkplayer is denpendent on ijkffmpeg.
- FFmpegTutorial is denpendent on fftutorial.
- when install pre-compiled lib, will containes it's denpendencies.
- To download pre-compiled xcframework libraries, add the --fmwk parameter when using the install command.
- To skip pulling existing remote repositories during initialization, add the --skip-pull-base parameter when using the init command. Missing repositories will still be cloned.
- Currently, FFmpeg uses the module-full.sh configuration, resulting in slightly larger package sizes.
- You can download all pre-compiled GitHub libraries to your own server and specify your server address using MR_DOWNLOAD_BASEURL before running the install command.