Skip to content

Support OpenSSL and Libx264 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ defaults: &defaults
mkdir -p build_logs;
export FINAL_DIR=$(pwd)/artifacts/$TARGET;
export BUILD_DIR=$(pwd)/build_scripts/build_dir && mkdir -p $BUILD_DIR;
./build_scripts/build_ffmpeg.sh $TARGET $BUILD_DIR $FINAL_DIR;
./build_scripts/build_ffmpeg.sh $TARGET full $BUILD_DIR $FINAL_DIR;
./build_scripts/build_ffmpeg.sh $TARGET lite $BUILD_DIR $FINAL_DIR;
- run:
name: Copy error report
command: |
mkdir -p build_logs/ffmpeg;
cp build_scripts/ffmpeg-$FFMPEG_VERSION/config.log build_logs/ffmpeg/ || true;
cp ffmpeg-$FFMPEG_VERSION/config.log build_logs/ffmpeg/ || true;
when: on_fail
- store_artifacts:
path: build_logs
Expand Down Expand Up @@ -49,12 +50,12 @@ jobs:
TARGET: arm64-v8a
<< : *defaults

build_arm_x86:
build_x86:
environment:
TARGET: i686
<< : *defaults

build_arm_x86_64:
build_x86_64:
environment:
TARGET: x86_64
<< : *defaults
Expand Down Expand Up @@ -100,8 +101,8 @@ workflows:
- build_arm_v7a
- build_arm_v7a_neon
- build_arm_v8a
- build_arm_x86
- build_arm_x86_64
- build_x86
- build_x86_64
- build_native_linux
- hold:
type: approval
Expand All @@ -110,14 +111,14 @@ workflows:
- build_arm_v7a
- build_arm_v7a_neon
- build_arm_v8a
- build_arm_x86
- build_arm_x86_64
- build_x86
- build_x86_64
- build_native_linux
- create_release:
requires:
- hold
filters:
branches:
only: master
- create_release:
requires:
- hold


94 changes: 46 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
# FFmpeg Prebuilt Android
This repo contains static FFmpeg executable binary which compatible with all Android [ABIs](https://developer.android.com/ndk/guides/abis.html):
- `armeabi` (Android 16+)
- `armeabi-v7a` (Android 16+)
- `arm64-v8a` (Android 21+)
- `x86` (Android 16+)
- `x86_64` (Android 21+)
- `mips` (Android 16+)
- `mips64` (Android 21+)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Prebuilt%20FFmpeg%20Android-brightgreen.svg?style=flat-square)](https://android-arsenal.com/details/1/6815)

This is main configuration, optimizes for smallest binary size with most common media codecs and container formats:
```
[...]
--enable-pic \
--enable-small \
--enable-gpl \
\
--disable-shared \
--enable-static \
\
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
\
--disable-protocols \
--enable-protocol='file,pipe' \
\
--disable-demuxers \
--disable-muxers \
--enable-demuxer='aac,avi,dnxhd,flac,flv,gif,h261,h263,h264,image2,matroska,webm,mov,mp3,mp4,mpeg,ogg,srt,wav,webvtt' \
--enable-muxer='3gp,dnxhd,flac,flv,gif,image2,matroska,webm,mov,mp3,mp4,mpeg,ogg,opus,srt,wav,webvtt,ipod' \
\
--disable-encoders \
--disable-decoders \
--enable-encoder='aac,dnxhd,flac,flv,gif,libmp3lame,libopus,libshine,libvorbis,mpeg4,png,srt,subrip,webvtt' \
--enable-decoder='aac,aac_at,aac_fixed,aac_latm,dnxhd,flac,flv,h261,h263,h263i,h263p,h264,vp8,vp9,libopus,libvorbis,mp3,mpeg4,wavpack,png,rawvideo,srt,webvtt' \
\
--enable-libshine \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-bsf=aac_adtstoasc \
```
# Prebuilt FFmpeg Android
This repo contains build scripts to build FFmpeg executable binary for Android and also [publish prebuilt files here](https://github.com/Khang-NT/ffmpeg-binary-android/releases).
There are two build flavors: _FULL_ and _LITE_
* **LITE** is a version that optimized binrary size, so it only includes small set features to work with most commom formats and codecs.
+ ABI and android version supported:
- `armeabi` (Android 16+)
- `armeabi-v7a`, `armeabi-v7a-neon`, (Android 16+)
- `x86` (Android 16+)
- `arm64-v8a` (Android 21+)
- `x86_64` (Android 21+)
- ~~`mips` (Android 16+)~~ (No longer support)
- ~~`mips64` (Android 21+)~~ (No longer support)
+ Addition libraries: `libmp3lame`, `libshine`, `libopus`, `libvorbis`
* **FULL** is a version compiled full FFmpeg feature, include **https** support protocol.
+ ABI and android version supported:
- `armeabi` (Android **21+**)
- `armeabi-v7a`, `armeabi-v7a-neon`, (Android **21+**)
- `x86` (Android **21+**)
- `arm64-v8a` (Android 21+)
- `x86_64` (Android 21+)
+ Include libraries in `LITE` version, plus with: `libfdk-aac` (**non-free**), `libx264`, **`openssl`** (thanks to [leenjewel/openssl_for_ios_and_android](https://github.com/leenjewel/openssl_for_ios_and_android))

## Download
Latest build:
[![Latest build](https://img.shields.io/github/release/Khang-NT/ffmpeg-binary-android.svg?style=for-the-badge)](https://github.com/Khang-NT/ffmpeg-binary-android/releases)

## Build
You can build it and customize as you want using build scripts in [build_scripts](build_scripts) folder. (Recommended using Android NDK r15).
```
export NDK="path/to/ndk-r15"
./build_all.sh

Prerequisites:
* Android NDK r15
* `export NDK=path/to/android-ndk`

Build:
```bash
export NDK=path/to/android-ndk
cd build_scripts

FLAVOR=full # or "lite"
TARGET=armv7-a # Support targets: "arm", "armv7-a", "arm-v7n", "arm64-v8a", "i686", "x86_64"
BUILD_DIR=$(pwd)/build_dir
FINAL_DIR=$(pwd)/final/$TARGET

./build_ffmpeg.sh $TARGET $FLAVOR $BUILD_DIR $FINAL_DIR
```

## Referent
The `ffmpeg` binary should in folder `$FINAL_DIR/$TARGET/$FLAVOR/ffmpeg` after build succeed.

## References
- [FFmpegMediaPlayer](https://github.com/wseemann/FFmpegMediaPlayer) by [wseemann](https://github.com/wseemann)
- [PrebuiltOpenSSL](https://github.com/leenjewel/openssl_for_ios_and_android)

## FFmpeg license
This software uses code of <a href="http://ffmpeg.org">FFmpeg</a> licensed under the <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPLv2.1</a> and its source can be downloaded <a href="build_scripts/ffmpeg-3.3.2.tar.bz2">here</a>.
Expand Down
53 changes: 0 additions & 53 deletions build_scripts/build_all.sh

This file was deleted.

Loading