Compare commits

..

12 Commits

Author SHA1 Message Date
Taner Şener 7a9c62f556 Update FUNDING.yml 2021-10-07 09:42:47 +01:00
Taner Şener df463626f1 Update README.md 2021-04-16 17:58:12 +01:00
Taner Şener 94607015d9 Update README.md 2021-04-16 17:55:12 +01:00
Taner Şener 7710133dcf Add the link of medium article to the README 2021-04-16 17:54:43 +01:00
Taner Sener b0c3d5bb27 announce the retirement 2021-04-13 20:19:53 +01:00
Taner Sener 0dbbc5e11f Add mavenCentral() links 2021-02-07 20:51:34 +00:00
Taner Sener 195a809cca fix android async example 2020-11-03 22:24:10 +00:00
Taner Sener 0aae541e81 support iOS 14, fixes #553 2020-09-26 15:31:46 +01:00
Pete dda06154f1 Update arch-common.sh (#534)
* Update arch-common.sh

x265 download on Bitbucket no longer works. Use GitHub link instead
2020-08-24 13:50:51 +01:00
Taner Sener 725aef963c update the packaging for android arm-v7a and arm-v7a-neon architectures and remove custom abi rules for releases, fixes #511 2020-08-03 19:34:53 +01:00
Taner Sener 94adca685e fix proguard rules, fixes #508 2020-08-03 19:34:45 +01:00
Taner Şener 4f6e484d5b merge v4.4 to master (#503)
* cleanup openh264 build

* apply 'use build host and target host in build scripts' efe1c59a

* remove custom common_includes

The includes are handled by llvm via --sysroot parameter.

* remove unnecessary parameters for make command

using the names of compiler tools same way as they are used (without full path) for ffmpeg build

* let AndroidStudio manage project root

* import cpufeatures from NDK

* Enable stale action

* Use JSON parsing in getMediaInformation, fixes #417

* Remove internal log line limit on Android, fixes #418

* add support for vo-amrwbenc, fixes #381

* Enable all gpl libraries when both --full and --enable-gpl flags are present, fixes #394

* let the project be opened and managed in Android Studio

* bring in cpu_features as a submodule

* add cpu_features script

and some helper fuctions to android-common

* fix lint errors

* use cpu_features script

it's a regular library, only it's enabled by default

* import cpu_features into Android.mk

also clean up the Android.mk files a bit
also, import libc++_shared correctly, so that it is packed in AAR

* fix Android.lts.mk

* with NDK r20 and higher, openh264.a does not depend on libc++

* Revert "with NDK r20 and higher, openh264.a does not depend on libc++"

This reverts commit dc751016

* Revert a (small) portion of commit e77f8971

On lower API, openh264 depends on libc++_shared. Here, for simplicity, we force this dependency for all API levels.

* LTS: fix the static constructor blocks to handle the changed name of the cpu features library

Also, add ffmpeg dependencies for lower APIs (how did it work before?)
Also, just try to load c++_shared if it is present, not trying to guess whether the external libraries require it (android.sh will still make the decision to add c++_shared to dependencies list based on the list of external libraries).

* switch the submodule to fork

* rename the submodule library

* scripts changed for renamed libary and move cpu-features to slot 47

create_cpufeatures_package_config moved back to android-common.sh
android_ndk_cmake to handle generic Android-NDK toolchain invocation of cmake

* update the Android.mk files to reflect cpu-features rename

also, remove unnecessary dependencies

* fix for LTS

* not needed anymore

* revert the commit 740fd2e9

load of c++_shared determined by the list of enabled external libraries

* Using static lib for Google cpu-features

* let openh264 work with external cpu-features

compatible with NDK deperecated implementation and with ndk_compat from https://github.com/google/cpu_features

* set packages path

* make android-cpu-features.sh executable

* automatically update submodules from android.sh

* disable publishing to bintray

* bump version

* list cpu-features after builtin libraries

* fix javadoc warnings

* disable stripping of debug symbols for ffmpeg, fixes #447

* do not detach main thread on error cases, fixes #446

* release unreleased utf strings in setNativeEnvironmentVariable(), fixes #443

* implement toString() method for Statistics and LogMessage classes, fixes #438

* do not install lldb for android in travis builds

* fix travis builds

* remove unused test resources

* switch src/cpu-features remote to google/cpu_features

* switch expat source code with expat submodule

* update submodules in top level build scripts

* switch openh264 source code with openh264 submodule

* implement bash functions to download external libraries

* implement ignoreSignal api method, fixes #258, #214

* use the latest android ndk

* disable avfoundation device for ios lts releases, fixes #462

* update ios test-app versions

* implement an api method to set environment variables, fixes #466

* update release scripts to use the latest ndk version

* update stale.yml

* implement ffmpeg async api

* add executionId to log and statistic callbacks

* fix ndk version in travis

* fix test commands in android test app

* fix android env variables  in travis

* switch to personal fork for cpu-features, use in-repo sources for expat and openh264

* introduce an api method to list ongoing executions

* use a thread safe implementation to list ongoing executions

* add startTime to FFmpegExecution class

* test openh264 in ios/tvos test applications

* use new x265 version v3.4

* use new x264 version v20200630-stable

* use new chromaprint version v1.5.0

* use new wavpack version v5.3.0

* use new kvazaar version v2.0.0

* use new libvorbis version v1.3.7

* use new nettle version v3.6

* use new libjpeg-turbo version v2.0.5

* use new ffmpeg version v4.4-dev-416-g1998d1d6af

* remove coreimage references on ios/tvos, fixes #480

* use new freetype version 2.10.2

* enable redownloading of ffmpeg source code

* freeze v4.4

* disable building of audiotoolbox output device on ios/tvos

* do not process log lines with zero length on ios/tvos

* update libsamplerate build workarounds

* do not print parsing exceptions for not found keys on android

* synchronize updating lastCommandOutput on ios/tvos, fixes #494

* introduce execution specific log levels, fixes #495

* fix x265 compilation errors on ios/tvos

* fix android lts neon packaging

* fix processing of ios/tvos flags

* fix mobile-ffmpeg videotoolbox flags for tvos

* release v4.4.LTS

* use v4.4.LTS in test applications

* fix ios/tvos system library indexes in ffmpeg build scripts

* update ios test-app settings

* fix android release packaging script

* Update README

Co-authored-by: alexcohn <sasha.cohn@gmail.com>
2020-07-29 21:28:04 +01:00
38 changed files with 428 additions and 959 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
open_collective: mobile-ffmpeg
patreon: tanersener
custom: ['https://buymeacoff.ee/tanersener','https://paypal.me/teodosiyminchev']
open_collective: mobile-ffmpeg
custom: ['https://buymeacoff.ee/tanersener']
+15 -4
View File
@@ -1,12 +1,14 @@
# MobileFFmpeg [![Financial Contributors on Open Collective](https://opencollective.com/mobile-ffmpeg/all/badge.svg?label=financial+contributors)](https://opencollective.com/mobile-ffmpeg) ![GitHub release](https://img.shields.io/badge/release-v4.4-blue.svg) ![Bintray](https://img.shields.io/badge/bintray-v4.4-blue.svg) ![CocoaPods](https://img.shields.io/badge/pod-v4.4-blue.svg) [![Build Status](https://travis-ci.org/tanersener/mobile-ffmpeg.svg?branch=master)](https://travis-ci.org/tanersener/mobile-ffmpeg)
# MobileFFmpeg [![Financial Contributors on Open Collective](https://opencollective.com/mobile-ffmpeg/all/badge.svg?label=financial+contributors)](https://opencollective.com/mobile-ffmpeg) ![GitHub release](https://img.shields.io/badge/release-v4.4-blue.svg) ![Maven Central](https://img.shields.io/maven-central/v/com.arthenica/mobile-ffmpeg-min) ![CocoaPods](https://img.shields.io/badge/pod-v4.4-blue.svg) [![Build Status](https://travis-ci.org/tanersener/mobile-ffmpeg.svg?branch=master)](https://travis-ci.org/tanersener/mobile-ffmpeg)
FFmpeg for Android, iOS and tvOS
FFmpeg for Android, iOS and tvOS.
Not maintained anymore as explained in [Whats next for MobileFFmpeg?](https://tanersener.medium.com/whats-next-for-mobileffmpeg-44d2fac6f09b). Superseded by [FFmpegKit](https://github.com/tanersener/ffmpeg-kit).
<img src="https://github.com/tanersener/mobile-ffmpeg/blob/master/docs/assets/mobile-ffmpeg-logo-v7.png" width="320">
### 1. Features
- Includes both `FFmpeg` and `FFprobe`
- Use binaries available at `Github`/`JCenter`/`CocoaPods` or build your own version with external libraries you need
- Use binaries available at `Github`/`Maven Central`/`CocoaPods` or build your own version with external libraries you need
- Supports
- Android, iOS and tvOS
- FFmpeg `v3.4.x`, `v4.0.x`, `v4.1`, `v4.2` , `v4.3` and `v4.4-dev` releases
@@ -56,7 +58,7 @@ FFmpeg for Android, iOS and tvOS
### 2. Using
Prebuilt binaries are available at [Github](https://github.com/tanersener/mobile-ffmpeg/releases), [JCenter](https://bintray.com/bintray/jcenter) and [CocoaPods](https://cocoapods.org).
Prebuilt binaries are available at [Github](https://github.com/tanersener/mobile-ffmpeg/releases), [Maven Central](https://repo1.maven.org/maven2) and [CocoaPods](https://cocoapods.org).
#### 2.1 Packages
@@ -122,6 +124,15 @@ Please remember that some parts of `FFmpeg` are licensed under the `GPL` and onl
- `vo-amrwbenc` is supported since `v4.4`
#### 2.2 Android
- For versions `4.4` and `4.4.LTS`, add `mavenCentral()` to your `build.gradle` and make sure that it is listed
before `jcenter()`
- For `4.3.2` and older releases, add `jcenter()`
```
repositories {
mavenCentral()
}
```
1. Add MobileFFmpeg dependency to your `build.gradle` in `mobile-ffmpeg-<package name>` pattern.
```
dependencies {
+1 -5
View File
@@ -159,7 +159,6 @@ When compilation ends an Android Archive (AAR) file is created under the prebuil
echo -e " --reconf-LIBRARY\t\trun autoreconf before building LIBRARY [no]"
echo -e " --redownload-LIBRARY\t\tdownload LIBRARY even it is detected as already downloaded [no]"
echo -e " --rebuild-LIBRARY\t\tbuild LIBRARY even it is detected as already built [no]\n"
echo -e " --no-archive\t\tdo not build Android archive [no]\n"
}
display_version() {
@@ -703,9 +702,6 @@ while [ ! $# -eq 0 ]; do
redownload_library ${DOWNLOAD_LIBRARY}
;;
--no-archive)
NO_ARCHIVE="1"
;;
--full)
BUILD_FULL="1"
;;
@@ -848,7 +844,7 @@ if [[ ${ENABLED_ARCHITECTURES[4]} -eq 1 ]]; then
ANDROID_ARCHITECTURES+="$(get_android_arch 4) "
fi
if [[ ! -z ${ANDROID_ARCHITECTURES} ]] && [ -z ${NO_ARCHIVE} ]; then
if [[ ! -z ${ANDROID_ARCHITECTURES} ]]; then
echo -n -e "\nmobile-ffmpeg: "
+9 -6
View File
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 30
compileSdkVersion 29
ndkVersion "21.3.6528147"
defaultConfig {
minSdkVersion 24
targetSdkVersion 30
targetSdkVersion 29
versionCode 240440
versionName "4.4"
project.archivesBaseName = "mobile-ffmpeg"
@@ -31,11 +31,14 @@ android {
}
}
task javadoc(type: Javadoc) {
title = 'MobileFFmpeg'
destinationDir = file("${projectDir}/../../docs/android/javadoc")
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
source = android.sourceSets.main.java.srcDirs
}
dependencies {
testImplementation "androidx.test.ext:junit:1.1.1"
testImplementation "org.json:json:20190722"
}
if (System.properties.containsKey('releaseMobileFFmpeg')) {
apply from: "${rootProject.projectDir}/../tools/release/android/release.template.gradle"
}
-1
View File
@@ -9,7 +9,6 @@
native <methods>;
void log(long, int, byte[]);
void statistics(long, int, float, float, long , int, double, double);
void closeParcelFileDescriptor(int);
}
-keep class com.arthenica.mobileffmpeg.AbiDetect {
@@ -51,8 +51,6 @@
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "saf_wrapper.h"
#ifdef _WIN32
#undef main /* We don't want SDL to override our main() */
#endif
+1 -21
View File
@@ -79,9 +79,6 @@ static jmethodID logMethod;
/** Global reference of statistics redirection method in Java */
static jmethodID statisticsMethod;
/** Global reference of closeParcelFileDescriptor method in Java */
static jmethodID closeParcelFileDescriptorMethod;
/** Global reference of String class in Java */
static jclass stringClass;
@@ -309,8 +306,6 @@ void monitorWait(int milliSeconds) {
ts.tv_nsec = tp.tv_usec * 1000;
ts.tv_sec += milliSeconds / 1000;
ts.tv_nsec += (milliSeconds % 1000)*1000000;
ts.tv_sec += ts.tv_nsec / 1000000000L;
ts.tv_nsec = ts.tv_nsec % 1000000000L;
pthread_mutex_lock(&monitorMutex);
pthread_cond_timedwait(&monitorCondition, &monitorMutex, &ts);
@@ -658,12 +653,6 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
return JNI_FALSE;
}
closeParcelFileDescriptorMethod = (*env)->GetStaticMethodID(env, localConfigClass, "closeParcelFileDescriptor", "(I)V");
if (logMethod == NULL) {
LOGE("OnLoad thread failed to GetStaticMethodID for %s.\n", "closeParcelFileDescriptor");
return JNI_FALSE;
}
stringConstructor = (*env)->GetMethodID(env, localStringClass, "<init>", "([BLjava/lang/String;)V");
if (stringConstructor == NULL) {
LOGE("OnLoad thread failed to GetMethodID for %s.\n", "<init>");
@@ -699,7 +688,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
* @param object reference to the class on which this method is invoked
* @param level log level
*/
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel(JNIEnv *env, jclass object, jint level) {
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel(JNIEnv *env, jclass object, jint level) {
configuredLogLevel = level;
}
@@ -952,12 +941,3 @@ JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_ignoreNativeSignal
handleSIGPIPE = 0;
}
}
/**
* used by saf_wrapper; is expected to be called from a Java thread, therefore we don't need attach/detach
*/
void closeParcelFileDescriptor(int fd) {
JNIEnv *env = NULL;
(*globalVm)->GetEnv(globalVm, (void**) &env, JNI_VERSION_1_6);
(*env)->CallStaticVoidMethod(env, configClass, closeParcelFileDescriptorMethod, fd);
}
-134
View File
@@ -1,134 +0,0 @@
/*
* Copyright (c) 2020 Taner Sener
*
* This file is part of MobileFFmpeg.
*
* MobileFFmpeg is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MobileFFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include "config.h"
#include "libavformat/avformat.h"
#include "libavutil/avstring.h"
#include "saf_wrapper.h"
/** JNI wrapper in mobileffmpeg.c */
void closeParcelFileDescriptor(int fd);
// in these wrappers, we call the original functions, so we remove the shadow defines
#undef avio_closep
#undef avformat_close_input
#undef avio_open
#undef avio_open2
#undef avformat_open_input
static int fd_read_packet(void* opaque, uint8_t* buf, int buf_size) {
int fd = (int)opaque;
return read(fd, buf, buf_size);
}
static int fd_write_packet(void* opaque, uint8_t* buf, int buf_size) {
int fd = (int)opaque;
return write(fd, buf, buf_size);
}
static int64_t fd_seek(void *opaque, int64_t offset, int whence) {
int fd = (int)opaque;
if (fd < 0) {
return AVERROR(EINVAL);
}
int64_t ret;
if (whence == AVSEEK_SIZE) {
struct stat st;
ret = fstat(fd, &st);
return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : st.st_size);
}
ret = lseek(fd, offset, whence);
return ret < 0 ? AVERROR(errno) : ret;
}
/*
* returns NULL if the filename is not of expected format (e.g. 'saf:72/video.md4')
*/
static AVIOContext *create_fd_avio_context(const char *filename, int flags) {
union {int fd; void* opaque;} fdunion;
fdunion.fd = -1;
const char *fd_ptr = NULL;
if (av_strstart(filename, "saf:", &fd_ptr)) {
char *final;
fdunion.fd = strtol(fd_ptr, &final, 10);
if (fd_ptr == final) { /* No digits found */
fdunion.fd = -1;
}
}
if (fdunion.fd >= 0) {
int write_flag = flags & AVIO_FLAG_WRITE ? 1 : 0;
return avio_alloc_context(av_malloc(4096), 4096, write_flag, fdunion.opaque, fd_read_packet, write_flag ? fd_write_packet : NULL, fd_seek);
}
return NULL;
}
static void close_fd_avio_context(AVIOContext *ctx) {
if (fd_seek(ctx->opaque, 0, AVSEEK_SIZE) >= 0) {
int fd = (int)ctx->opaque;
closeParcelFileDescriptor(fd);
}
ctx->opaque = NULL;
}
int android_avformat_open_input(AVFormatContext **ps, const char *filename,
ff_const59 AVInputFormat *fmt, AVDictionary **options) {
if (!(*ps) && !(*ps = avformat_alloc_context()))
return AVERROR(ENOMEM);
(*ps)->pb = create_fd_avio_context(filename, AVIO_FLAG_READ);
return avformat_open_input(ps, filename, fmt, options);
}
int android_avio_open2(AVIOContext **s, const char *filename, int flags,
const AVIOInterruptCB *int_cb, AVDictionary **options) {
AVIOContext *fd_context = create_fd_avio_context(filename, flags);
if (fd_context) {
*s = fd_context;
return 0;
}
return avio_open2(s, filename, flags, int_cb, options);
}
int android_avio_open(AVIOContext **s, const char *url, int flags) {
return android_avio_open2(s, url, flags, NULL, NULL);
}
int android_avio_closep(AVIOContext **s) {
close_fd_avio_context(*s);
return avio_closep(s);
}
void android_avformat_close_input(AVFormatContext **ps) {
if (*ps && (*ps)->pb) {
close_fd_avio_context((*ps)->pb);
}
avformat_close_input(ps);
}
-46
View File
@@ -1,46 +0,0 @@
/*
* Copyright (c) 2020 Taner Sener
*
* This file is part of MobileFFmpeg.
*
* MobileFFmpeg is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MobileFFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MOBILE_FFMPEG_SAF_WRAPPER_H
#define MOBILE_FFMPEG_SAF_WRAPPER_H
/*
* These wrappers are intended to be used instead of the ffmpeg apis.
* You don't even need to change the source to call them.
* Instead, we redefine the public api names so that the wrapper be used.
*/
int android_avio_closep(AVIOContext **s);
#define avio_closep android_avio_closep
void android_avformat_close_input(AVFormatContext **s);
#define avformat_close_input android_avformat_close_input
int android_avio_open(AVIOContext **s, const char *url, int flags);
#define avio_open android_avio_open
int android_avio_open2(AVIOContext **s, const char *url, int flags,
const AVIOInterruptCB *int_cb, AVDictionary **options);
#define avio_open2 android_avio_open2
int android_avformat_open_input(AVFormatContext **ps, const char *filename,
ff_const59 AVInputFormat *fmt, AVDictionary **options);
#define avformat_open_input android_avformat_open_input
#endif //MOBILE_FFMPEG_SAF_WRAPPER_H
@@ -20,13 +20,8 @@
package com.arthenica.mobileffmpeg;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsContract;
import android.util.Log;
import android.util.SparseArray;
import java.io.File;
import java.io.FileOutputStream;
@@ -85,7 +80,6 @@ public class Config {
private static int lastCreatedPipeIndex;
private static final List<FFmpegExecution> executions;
private static SparseArray<ParcelFileDescriptor> pfdmap = new SparseArray<>();
static {
@@ -775,58 +769,4 @@ public class Config {
*/
private native static void ignoreNativeSignal(final int signum);
/**
* <p>Convert Structured Access Framework Uri (<code></code>"content:…"</code>) for MobileFfmpeg.
*
* @return String can be passed to FFmpeg or FFprobe
*/
private static String getSafParameter(Context context, Uri uri, String openMode) {
String displayName = "unknown";
try (Cursor cursor = context.getContentResolver().query(uri, null, null, null, null)) {
if (cursor != null && cursor.moveToFirst()) {
displayName = cursor.getString(cursor.getColumnIndex(DocumentsContract.Document.COLUMN_DISPLAY_NAME));
}
} catch (Throwable ex) {
Log.e(TAG, "failed to get column", ex);
}
int fd = -1;
try {
ParcelFileDescriptor parcelFileDescriptor = context.getContentResolver().openFileDescriptor(uri, openMode);
fd = parcelFileDescriptor.getFd();
pfdmap.put(fd, parcelFileDescriptor);
} catch (Throwable e) {
Log.e(TAG, "obtaining " + openMode + " ParcelFileDescriptor for " + uri, e);
}
// workaround for https://issuetracker.google.com/issues/162440528: ANDROID_CREATE_DOCUMENT generating file names like "transcode.mp3 (2)"
if (displayName.lastIndexOf('.') > 0 && displayName.lastIndexOf(' ') > displayName.lastIndexOf('.')) {
String extension = displayName.substring(displayName.lastIndexOf('.'), displayName.lastIndexOf(' '));
displayName += extension;
}
// spaces can break argument list parsing, see https://github.com/alexcohn/mobile-ffmpeg/pull/1#issuecomment-688643836
final char NBSP = (char)0xa0;
return "saf:" + fd + "/" + displayName.replace(' ', NBSP);
}
public static String getSafParameterForRead(Context context, Uri uri) {
return getSafParameter(context, uri, "r");
}
public static String getSafParameterForWrite(Context context, Uri uri) {
return getSafParameter(context, uri, "w");
}
private static void closeParcelFileDescriptor(int fd) {
try {
ParcelFileDescriptor pfd = pfdmap.get(fd);
if (pfd != null) {
pfd.close();
pfdmap.delete(fd);
}
} catch (Throwable e) {
Log.e(TAG, "closeParcelFileDescriptor " + fd, e);
}
}
}
+2 -1
View File
@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:3.6.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -16,6 +16,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
#Thu Jul 30 09:25:25 BST 2020
#Sat May 09 20:36:16 IDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
+2 -3
View File
@@ -13,8 +13,10 @@ ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
endif
ifeq ($(MY_ARMV7_NEON), true)
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/android-$(TARGET_ARCH)/neon/ffmpeg/include
$(call import-module, cpu-features/neon)
else
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/android-$(TARGET_ARCH)/ffmpeg/include
$(call import-module, cpu-features)
endif
MY_ARM_MODE := arm
@@ -48,8 +50,6 @@ LOCAL_STATIC_LIBRARIES := cpu-features
LOCAL_ARM_NEON := ${MY_ARM_NEON}
include $(BUILD_SHARED_LIBRARY)
$(call import-module, cpu-features)
ifeq ($(TARGET_PLATFORM),android-16)
MY_SRC_FILES := mobileffmpeg.c mobileffprobe.c android_lts_support.c mobileffmpeg_exception.c fftools_cmdutils.c fftools_ffmpeg.c fftools_ffprobe.c fftools_ffmpeg_opt.c fftools_ffmpeg_hw.c fftools_ffmpeg_filter.c
else ifeq ($(TARGET_PLATFORM),android-17)
@@ -57,7 +57,6 @@ else ifeq ($(TARGET_PLATFORM),android-17)
else
MY_SRC_FILES := mobileffmpeg.c mobileffprobe.c mobileffmpeg_exception.c fftools_cmdutils.c fftools_ffmpeg.c fftools_ffprobe.c fftools_ffmpeg_opt.c fftools_ffmpeg_hw.c fftools_ffmpeg_filter.c
endif
MY_SRC_FILES += saf_wrapper.c
MY_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-switch -Wno-sign-compare
MY_LDLIBS := -llog -lz -landroid
+1 -5
View File
@@ -1,8 +1,4 @@
ifeq ($(MY_ARMV7_NEON), true)
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)/neon/cpu-features/lib
else
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)/cpu-features/lib
endif
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)/cpu-features/lib
include $(CLEAR_VARS)
LOCAL_ARM_MODE := $(MY_ARM_MODE)
+8
View File
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)/../../../../prebuilt/android-$(TARGET_ARCH)/neon/cpu-features/lib
include $(CLEAR_VARS)
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_MODULE := cpu-features
LOCAL_SRC_FILES := libndk_compat.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../include/ndk_compat
include $(PREBUILT_STATIC_LIBRARY)
+4 -4
View File
@@ -9,11 +9,11 @@ android {
keyPassword 'android'
}
}
compileSdkVersion 30
compileSdkVersion 29
defaultConfig {
applicationId "com.arthenica.mobileffmpeg.test"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 29
versionCode 160440
versionName "4.4.LTS"
}
@@ -51,8 +51,8 @@ android.applicationVariants.all { variant ->
}
dependencies {
implementation project(':app')
// implementation 'com.arthenica:mobile-ffmpeg-full:4.4.LTS'
// implementation project(':app')
implementation 'com.arthenica:mobile-ffmpeg-full:4.4.LTS'
implementation 'com.arthenica:smart-exception-java:0.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
@@ -198,7 +198,7 @@ public class AudioTabFragment extends Fragment implements AdapterView.OnItemSele
String ffmpegCommand = String.format("-hide_banner -y -f lavfi -i sine=frequency=1000:duration=5 -c:a pcm_s16le %s", audioSampleFile.getAbsolutePath());
android.util.Log.d(TAG, String.format("Creating audio sample with '%s'.", ffmpegCommand));
android.util.Log.d(TAG, String.format("Sample file is created with '%s'.", ffmpegCommand));
int result = FFmpeg.execute(ffmpegCommand);
if (result == 0) {
@@ -263,7 +263,7 @@ public class AudioTabFragment extends Fragment implements AdapterView.OnItemSele
disableLogCallback();
createAudioSample();
enableLogCallback();
Popup.show(requireContext(), getString(R.string.audio_test_tooltip_text));
Popup.show(requireContext(), Tooltip.AUDIO_TEST_TOOLTIP_TEXT);
}
public void appendLog(final String logMessage) {
@@ -148,7 +148,7 @@ public class CommandTabFragment extends Fragment {
private void setActive() {
Log.i(MainActivity.TAG, "Command Tab Activated");
enableLogCallback();
Popup.show(requireContext(), getString(R.string.command_test_tooltip_text));
Popup.show(requireContext(), Tooltip.COMMAND_TEST_TOOLTIP_TEXT);
}
public void appendLog(final String logMessage) {
@@ -263,7 +263,7 @@ public class ConcurrentExecutionTabFragment extends Fragment {
public void setActive() {
Log.i(MainActivity.TAG, "Concurrent Execution Tab Activated");
enableLogCallback();
Popup.show(requireContext(), getString(R.string.concurrent_execution_test_tooltip_text));
Popup.show(requireContext(), Tooltip.CONCURRENT_EXECUTION_TEST_TOOLTIP_TEXT);
}
public void appendLog(final String logMessage) {
@@ -64,7 +64,7 @@ public class HttpsTabFragment extends Fragment {
@Override
public void onClick(View v) {
runGetMediaInformation();
getInfo();
}
});
@@ -99,7 +99,7 @@ public class HttpsTabFragment extends Fragment {
});
}
public void runGetMediaInformation() {
public void getInfo() {
clearLog();
String testUrl = urlText.getText().toString();
@@ -216,7 +216,7 @@ public class HttpsTabFragment extends Fragment {
public void setActive() {
Log.i(MainActivity.TAG, "Https Tab Activated");
enableLogCallback();
Popup.show(requireContext(), getString(R.string.https_test_tooltip_text));
Popup.show(requireContext(), Tooltip.HTTPS_TEST_TOOLTIP_TEXT);
}
public void appendLog(final String logMessage) {
@@ -26,7 +26,7 @@ import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
public class PagerAdapter extends FragmentPagerAdapter {
private static final int NUMBER_OF_TABS = 9;
private static final int NUMBER_OF_TABS = 8;
private final Context context;
@@ -62,9 +62,6 @@ public class PagerAdapter extends FragmentPagerAdapter {
case 7: {
return ConcurrentExecutionTabFragment.newInstance();
}
case 8: {
return SafTabFragment.newInstance();
}
default: {
return null;
}
@@ -103,9 +100,6 @@ public class PagerAdapter extends FragmentPagerAdapter {
case 7: {
return context.getString(R.string.concurrent_tab);
}
case 8: {
return context.getString(R.string.saf_tab);
}
default: {
return null;
}
@@ -226,7 +226,7 @@ public class PipeTabFragment extends Fragment {
Log.i(MainActivity.TAG, "Pipe Tab Activated");
enableLogCallback();
enableStatisticsCallback();
Popup.show(requireContext(), getString(R.string.pipe_test_tooltip_text));
Popup.show(requireContext(), Tooltip.PIPE_TEST_TOOLTIP_TEXT);
}
protected void showProgressDialog() {
@@ -1,420 +0,0 @@
/*
* Copyright (c) 2018 Taner Sener
*
* This file is part of MobileFFmpeg.
*
* MobileFFmpeg is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MobileFFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
*/
package com.arthenica.mobileffmpeg.test;
import android.app.AlertDialog;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.util.AndroidRuntimeException;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.arthenica.mobileffmpeg.Config;
import com.arthenica.mobileffmpeg.ExecuteCallback;
import com.arthenica.mobileffmpeg.FFmpeg;
import com.arthenica.mobileffmpeg.FFprobe;
import com.arthenica.mobileffmpeg.LogCallback;
import com.arthenica.mobileffmpeg.LogMessage;
import com.arthenica.mobileffmpeg.Statistics;
import com.arthenica.mobileffmpeg.StatisticsCallback;
import com.arthenica.mobileffmpeg.util.DialogUtil;
import com.arthenica.mobileffmpeg.util.ResourcesUtil;
import com.arthenica.smartexception.java.Exceptions;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.concurrent.Callable;
import static android.app.Activity.RESULT_OK;
import static com.arthenica.mobileffmpeg.Config.RETURN_CODE_SUCCESS;
import static com.arthenica.mobileffmpeg.test.MainActivity.TAG;
public class SafTabFragment extends Fragment {
private TextView outputText;
private Uri inUri;
private Uri outUri;
private static final int REQUEST_SAF_FFPROBE = 11;
private static final int REQUEST_SAF_FFMPEG = 12;
private boolean backFromIntent = false;
private VideoView videoView;
private AlertDialog progressDialog;
private Statistics statistics;
private Button runFFmpegButton;
private Button runFFprobeButton;
public SafTabFragment() {
super(R.layout.fragment_saf_tab);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
runFFmpegButton = view.findViewById(R.id.runFFmpegButton);
runFFmpegButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT)
.setType("video/*")
.putExtra(Intent.EXTRA_TITLE, "video.mp4")
.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent, REQUEST_SAF_FFMPEG);
}
});
runFFprobeButton = view.findViewById(R.id.runFFprobeButton);
runFFprobeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT)
.setType("*/*")
.putExtra(Intent.EXTRA_MIME_TYPES, new String[]{"image/*", "video/*", "audio/*"})
.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent, REQUEST_SAF_FFPROBE);
}
});
outputText = view.findViewById(R.id.outputText);
outputText.setMovementMethod(new ScrollingMovementMethod());
videoView = view.findViewById(R.id.videoPlayerFrame);
progressDialog = DialogUtil.createProgressDialog(requireContext(), "Encoding video");
}
@Override
public void onResume() {
super.onResume();
setActive();
}
static SafTabFragment newInstance() {
return new SafTabFragment();
}
private void enableLogCallback() {
Config.enableLogCallback(new LogCallback() {
@Override
public void apply(final LogMessage message) {
MainActivity.addUIAction(new Callable() {
@Override
public Object call() {
appendLog(message.getText());
return null;
}
});
}
});
}
private void runFFprobe() {
videoView.setVisibility(View.GONE);
outputText.setVisibility(View.VISIBLE);
clearLog();
final String ffprobeCommand = "-hide_banner -print_format json -show_format -show_streams " + Config.getSafParameterForRead(getContext(), inUri);
Log.d(TAG, "Testing FFprobe COMMAND synchronously.");
Log.d(TAG, String.format("FFprobe process started with arguments\n\'%s\'", ffprobeCommand));
int result = FFprobe.execute(ffprobeCommand);
Log.d(TAG, String.format("FFprobe process exited with rc %d", result));
if (result != 0) {
Popup.show(requireContext(), "Command failed. Please check output for the details.");
}
inUri = null;
}
private void setActive() {
if (backFromIntent) {
backFromIntent = false;
return;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Popup.show(requireContext(), "SAF is only available for Android 4.4 and above.");
runFFprobeButton.setEnabled(false);
runFFmpegButton.setEnabled(false);
outputText.setEnabled(false);
Log.i(TAG, "SAF Tab Dectivated");
return;
}
Log.i(TAG, "SAF Tab Activated");
enableLogCallback();
enableStatisticsCallback();
Popup.show(requireContext(), getString(R.string.saf_test_tooltip_text));
}
private void appendLog(final String logMessage) {
outputText.append(logMessage);
}
private void clearLog() {
outputText.setText("");
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
backFromIntent = true;
if (requestCode == REQUEST_SAF_FFPROBE && resultCode == RESULT_OK && data != null) {
inUri = data.getData();
MainActivity.handler.post(new Runnable() {
@Override
public void run() {
runFFprobe();
}
});
} else if (requestCode == REQUEST_SAF_FFMPEG && resultCode == MainActivity.RESULT_OK && data != null) {
outUri = data.getData();
MainActivity.handler.post(new Runnable() {
@Override
public void run() {
encodeVideo();
}
});
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
private String getCodec(String videoPath) {
String extension = "mp4";
int pos = videoPath.lastIndexOf('.');
if (pos >= 0)
extension = videoPath.substring(pos+1);
switch (extension) {
case "webm":
return "vp8";
case "mkv":
return "aom";
case "ogv":
return "theora";
case "mov":
return "hap";
case "mp4":
default:
return "mpeg4";
}
}
private String getCustomOptions(String videoCodec) {
switch (videoCodec) {
case "x265":
return "-crf 28 -preset fast ";
case "vp8":
return "-b:v 1M -crf 10 ";
case "vp9":
return "-b:v 2M ";
case "aom":
return "-crf 30 -strict experimental ";
case "theora":
return "-qscale:v 7 ";
case "hap":
return "-format hap_q ";
default:
// kvazaar, mpeg4, x264, xvid
return "";
}
}
private void enableStatisticsCallback() {
Config.enableStatisticsCallback(new StatisticsCallback() {
@Override
public void apply(final Statistics newStatistics) {
MainActivity.addUIAction(new Callable<Object>() {
@Override
public Object call() {
statistics = newStatistics;
updateProgressDialog();
return null;
}
});
throw new AndroidRuntimeException("I am test exception thrown by test application");
}
});
}
private void encodeVideo() {
final File image1File = new File(requireContext().getCacheDir(), "colosseum.jpg");
final File image2File = new File(requireContext().getCacheDir(), "pyramid.jpg");
final File image3File = new File(requireContext().getCacheDir(), "tajmahal.jpg");
final String videoPath = Config.getSafParameterForWrite(requireContext(), outUri);
try {
// IF VIDEO IS PLAYING STOP PLAYBACK
videoView.stopPlayback();
videoView.setVisibility(View.GONE);
outputText.setVisibility(View.VISIBLE);
String selectedCodec = getCodec(videoPath);
Log.d(TAG, String.format("Testing VIDEO encoding with '%s' codec", selectedCodec));
showProgressDialog();
ResourcesUtil.resourceToFile(getResources(), R.drawable.colosseum, image1File);
ResourcesUtil.resourceToFile(getResources(), R.drawable.pyramid, image2File);
ResourcesUtil.resourceToFile(getResources(), R.drawable.tajmahal, image3File);
final String ffmpegCommand = Video.generateEncodeVideoScript(image1File.getAbsolutePath(), image2File.getAbsolutePath(), image3File.getAbsolutePath(), videoPath, selectedCodec, getCustomOptions(selectedCodec));
Log.d(TAG, String.format("FFmpeg process started with arguments\n'%s'.", ffmpegCommand));
long executionId = FFmpeg.executeAsync(ffmpegCommand, new ExecuteCallback() {
@Override
public void apply(final long executionId, final int returnCode) {
Log.d(TAG, String.format("FFmpeg process exited with rc %d.", returnCode));
Log.d(TAG, "FFmpeg process output:");
Config.printLastCommandOutput(Log.INFO);
hideProgressDialog();
MainActivity.addUIAction(new Callable<Object>() {
@Override
public Object call() {
if (returnCode == RETURN_CODE_SUCCESS) {
Log.d(TAG, "Encode completed successfully; playing video.");
playVideo(outUri, new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
videoView.setVisibility(View.GONE);
outputText.setVisibility(View.VISIBLE);
}
});
} else {
Popup.show(requireContext(), "Encode failed. Please check log for the details.");
Log.d(TAG, String.format("Encode failed with rc=%d.", returnCode));
}
return null;
}
});
}
});
Log.d(TAG, String.format("Async FFmpeg process started with executionId %d.", executionId));
} catch (IOException e) {
Log.e(TAG, String.format("Encode video failed %s.", Exceptions.getStackTraceString(e)));
Popup.show(requireContext(), "Encode video failed");
}
}
private void playVideo(Uri videoUri, MediaPlayer.OnCompletionListener onCompletionListener) {
videoView.setVisibility(View.VISIBLE);
outputText.setVisibility(View.GONE);
MediaController mediaController = new MediaController(requireContext());
mediaController.setAnchorView(videoView);
videoView.setVideoURI(videoUri);
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
videoView.setBackgroundColor(0x00000000);
}
});
videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
videoView.stopPlayback();
return false;
}
});
videoView.setOnCompletionListener(onCompletionListener);
videoView.start();
}
private void showProgressDialog() {
// CLEAN STATISTICS
statistics = null;
Config.resetStatistics();
progressDialog.show();
}
private void updateProgressDialog() {
if (statistics == null) {
return;
}
int timeInMilliseconds = this.statistics.getTime();
if (timeInMilliseconds > 0) {
int totalVideoDuration = 9000;
String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
TextView textView = progressDialog.findViewById(R.id.progressDialogText);
if (textView != null) {
textView.setText(String.format("Encoding video: %% %s.", completePercentage));
}
}
}
private void hideProgressDialog() {
progressDialog.dismiss();
MainActivity.addUIAction(new Callable<Object>() {
@Override
public Object call() {
progressDialog = DialogUtil.createProgressDialog(requireContext(), "Encoding video");
return null;
}
});
}
}
@@ -224,7 +224,7 @@ public class SubtitleTabFragment extends Fragment {
}
});
Log.d(TAG, String.format("Async FFmpeg process started with executionId %d.", executionId));
Log.d(TAG, String.format("FFmpeg started execution id: %d.", executionId));
} catch (IOException e) {
Log.e(TAG, String.format("Burn subtitles failed %s.", Exceptions.getStackTraceString(e)));
@@ -272,7 +272,7 @@ public class SubtitleTabFragment extends Fragment {
Log.i(MainActivity.TAG, "Subtitle Tab Activated");
enableLogCallback();
enableStatisticsCallback();
Popup.show(requireContext(), getString(R.string.subtitle_test_tooltip_text));
Popup.show(requireContext(), Tooltip.SUBTITLE_TEST_TOOLTIP_TEXT);
}
protected void showCreateProgressDialog() {
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2018 Taner Sener
*
* This file is part of MobileFFmpeg.
*
* MobileFFmpeg is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MobileFFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
*/
package com.arthenica.mobileffmpeg.test;
public interface Tooltip {
// COMMAND TEST
String COMMAND_TEST_TOOLTIP_TEXT = "Enter an FFmpeg command without 'ffmpeg' at the beginning and click one of the RUN buttons";
// VIDEO TEST
String VIDEO_TEST_TOOLTIP_TEXT = "Select a video codec and press ENCODE button";
// HTTPS TEST
String HTTPS_TEST_TOOLTIP_TEXT = "Enter the https url of a media file and click the button";
// AUDIO TEST
String AUDIO_TEST_TOOLTIP_TEXT = "Select an audio codec and press ENCODE button";
// SUBTITLE TEST
String SUBTITLE_TEST_TOOLTIP_TEXT = "Click the button to burn subtitles. Created video will play inside the frame below";
// VID.STAB TEST
String VIDSTAB_TEST_TOOLTIP_TEXT = "Click the button to stabilize video. Original video will play above and stabilized video will play below";
// PIPE TEST
String PIPE_TEST_TOOLTIP_TEXT = "Click the button to create a video using pipe redirection. Created video will play inside the frame below";
// CONCURRENT EXECUTION TEST
String CONCURRENT_EXECUTION_TEST_TOOLTIP_TEXT = " Use ENCODE nad CANCEL buttons to start/stop multiple execution";
}
@@ -282,7 +282,7 @@ public class VidStabTabFragment extends Fragment {
public void setActive() {
Log.i(MainActivity.TAG, "VidStab Tab Activated");
enableLogCallback();
Popup.show(requireContext(), getString(R.string.vidstab_test_tooltip_text));
Popup.show(requireContext(), Tooltip.VIDSTAB_TEST_TOOLTIP_TEXT);
}
protected void showCreateProgressDialog() {
@@ -261,6 +261,8 @@ public class VideoTabFragment extends Fragment implements AdapterView.OnItemSele
}
public String getSelectedVideoCodec() {
// NOTE THAT MPEG4 CODEC IS ASSIGNED HERE
String videoCodec = selectedCodec;
// VIDEO CODEC SPINNER HAS BASIC NAMES, FFMPEG NEEDS LONGER AND EXACT CODEC NAMES.
@@ -354,7 +356,7 @@ public class VideoTabFragment extends Fragment implements AdapterView.OnItemSele
Log.i(MainActivity.TAG, "Video Tab Activated");
enableLogCallback();
enableStatisticsCallback();
Popup.show(requireContext(), getString(R.string.video_test_tooltip_text));
Popup.show(requireContext(), Tooltip.VIDEO_TEST_TOOLTIP_TEXT);
}
protected void showProgressDialog() {
@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".SafTabFragment">
<Button
android:id="@+id/runFFmpegButton"
android:layout_width="140dp"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/rounded_button"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="@string/command_run_ffmpeg_button_text"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
tools:targetApi="jelly_bean" />
<Button
android:id="@+id/runFFprobeButton"
android:layout_width="140dp"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/rounded_button"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="@string/command_run_ffprobe_button_text"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
tools:targetApi="jelly_bean" />
<TextView
android:id="@+id/outputText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="6dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/rounded_output_frame"
android:fontFamily="sans-serif"
android:gravity="bottom"
android:overScrollMode="ifContentScrolls"
android:scrollbars="vertical"
android:textColor="@android:color/black"
android:textSize="14sp"
android:typeface="sans"
tools:targetApi="jelly_bean" />
<VideoView
android:visibility="gone"
android:id="@+id/videoPlayerFrame"
android:layout_width="wrap_content"
android:background="@drawable/rounded_video_frame"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_margin="20dp"
android:layout_weight="1" />
</LinearLayout>
@@ -8,7 +8,6 @@
<string name="vidstab_tab">VID.STAB</string>
<string name="pipe_tab">PIPE</string>
<string name="concurrent_tab">CONCURRENT</string>
<string name="saf_tab">SAF</string>
<string name="command_text_input_placeholder">Enter command</string>
<string name="command_run_ffmpeg_button_text">RUN FFMPEG</string>
<string name="command_run_ffprobe_button_text">RUN FFPROBE</string>
@@ -1,11 +0,0 @@
<resources>
<string name="command_test_tooltip_text">Enter an FFmpeg command without \'ffmpeg\' at the beginning and click one of the RUN buttons</string>
<string name="video_test_tooltip_text">Select a video codec and press ENCODE button</string>
<string name="https_test_tooltip_text">Enter the https url of a media file and click the button</string>
<string name="audio_test_tooltip_text">Select an audio codec and press ENCODE button</string>
<string name="subtitle_test_tooltip_text">Click the button to burn subtitles. Created video will play inside the frame below</string>
<string name="vidstab_test_tooltip_text">Click the button to stabilize video. Original video will play above and stabilized video will play below</string>
<string name="pipe_test_tooltip_text">Click the button to create a video using pipe redirection. Created video will play inside the frame below</string>
<string name="concurrent_execution_test_tooltip_text">Use ENCODE and CANCEL buttons to start/stop multiple execution</string>
<string name="saf_test_tooltip_text">Use system file picker to test scoped storage extension</string>
</resources>
+12 -3
View File
@@ -1,14 +1,14 @@
---
layout: default
---
FFmpeg for Android, iOS and tvOS
FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by [FFmpegKit](https://github.com/tanersener/ffmpeg-kit).
<img src="https://github.com/tanersener/mobile-ffmpeg/raw/dev-v3.x/docs/assets/mobile-ffmpeg-logo-v7.png" width="240">
### 1. Features
- Includes both `FFmpeg` and `FFprobe`
- Supports FFmpeg `v3.4.x`, `v4.0.x`, `v4.1`, `v4.2` , `v4.3` and `v4.4-dev` releases
- Use prebuilt binaries available under `Github`/`JCenter`/`CocoaPods` or build your own version with external libraries you need
- Use prebuilt binaries available under `Github`/`Maven Central`/`CocoaPods` or build your own version with external libraries you need
- Includes 29 external libraries, 5 GPL libraries and 14 architectures in total
- Exposes both FFmpeg library and MobileFFmpeg wrapper library capabilities
- Supports concurrent execution
@@ -35,7 +35,7 @@ FFmpeg for Android, iOS and tvOS
### 2. Using
Binaries are available at [Github](https://github.com/tanersener/mobile-ffmpeg/releases), [JCenter](https://bintray.com/bintray/jcenter) and [CocoaPods](https://cocoapods.org).
Binaries are available at [Github](https://github.com/tanersener/mobile-ffmpeg/releases), [Maven Central](https://repo1.maven.org/maven2) and [CocoaPods](https://cocoapods.org).
#### 2.1 Packages
@@ -87,6 +87,15 @@ Please remember that some parts of `FFmpeg` are licensed under the `GPL` and onl
- `vo-amrwbenc` is supported since `v4.4`
#### 2.2 Android
- For versions `4.4` and `4.4.LTS`, add `mavenCentral()` to your `build.gradle` and make sure that it is listed
before `jcenter()`
- For `4.3.2` and older releases, add `jcenter()`
```
repositories {
mavenCentral()
}
```
1. Add MobileFFmpeg dependency to your `build.gradle` in `mobile-ffmpeg-<package name>` pattern.
```
dependencies {
@@ -9,6 +9,14 @@
/* Begin PBXBuildFile section */
340FABBE2115A17600B33CE7 /* VidStabViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 340FABBC2115A17600B33CE7 /* VidStabViewController.h */; };
340FABBF2115A17600B33CE7 /* VidStabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340FABBD2115A17600B33CE7 /* VidStabViewController.m */; };
341D1E8223CA8F3E00B24203 /* libswscale.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E4923CA8F3C00B24203 /* libswscale.framework */; };
341D1E8523CA8F3E00B24203 /* libavdevice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E4C23CA8F3C00B24203 /* libavdevice.framework */; };
341D1E8F23CA8F3F00B24203 /* libavfilter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E5623CA8F3C00B24203 /* libavfilter.framework */; };
341D1E9423CA8F3F00B24203 /* libavformat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E5B23CA8F3D00B24203 /* libavformat.framework */; };
341D1E9B23CA8F3F00B24203 /* libavcodec.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E6223CA8F3D00B24203 /* libavcodec.framework */; };
341D1E9C23CA8F3F00B24203 /* libavutil.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E6323CA8F3D00B24203 /* libavutil.framework */; };
341D1EA123CA8F3F00B24203 /* mobileffmpeg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E6823CA8F3D00B24203 /* mobileffmpeg.framework */; };
341D1EAA23CA8F3F00B24203 /* libswresample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1E7123CA8F3E00B24203 /* libswresample.framework */; };
341D1EB723CA8F8400B24203 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 341D1EB623CA8F8400B24203 /* libiconv.tbd */; };
342900D422DE3AAB0071B2E4 /* MediaInformationParserTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 342900D322DE3AAB0071B2E4 /* MediaInformationParserTest.h */; };
342900D722DE3AB30071B2E4 /* MobileFFmpegTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 342900D522DE3AB30071B2E4 /* MobileFFmpegTest.h */; };
@@ -43,6 +51,7 @@
34DC789E21215B5800C3486C /* sil_open_font_license.txt in Resources */ = {isa = PBXBuildFile; fileRef = 34DC789A21215B5800C3486C /* sil_open_font_license.txt */; };
34E313FC24A533040004B1D7 /* ConcurrentExecutionViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34E313FA24A533040004B1D7 /* ConcurrentExecutionViewController.h */; };
34E313FD24A533040004B1D7 /* ConcurrentExecutionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E313FB24A533040004B1D7 /* ConcurrentExecutionViewController.m */; };
34F2036B24C31F61003C6973 /* openh264.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F2036A24C31F61003C6973 /* openh264.framework */; };
34FAE215209F7DDD005CE2AE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FAE214209F7DDD005CE2AE /* AppDelegate.m */; };
34FAE218209F7DDD005CE2AE /* CommandViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FAE217209F7DDD005CE2AE /* CommandViewController.m */; };
34FAE21B209F7DDD005CE2AE /* VideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FAE21A209F7DDD005CE2AE /* VideoViewController.m */; };
@@ -68,6 +77,14 @@
/* Begin PBXFileReference section */
340FABBC2115A17600B33CE7 /* VidStabViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VidStabViewController.h; sourceTree = "<group>"; };
340FABBD2115A17600B33CE7 /* VidStabViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VidStabViewController.m; sourceTree = "<group>"; };
341D1E4923CA8F3C00B24203 /* libswscale.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libswscale.framework; sourceTree = "<group>"; };
341D1E4C23CA8F3C00B24203 /* libavdevice.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libavdevice.framework; sourceTree = "<group>"; };
341D1E5623CA8F3C00B24203 /* libavfilter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libavfilter.framework; sourceTree = "<group>"; };
341D1E5B23CA8F3D00B24203 /* libavformat.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libavformat.framework; sourceTree = "<group>"; };
341D1E6223CA8F3D00B24203 /* libavcodec.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libavcodec.framework; sourceTree = "<group>"; };
341D1E6323CA8F3D00B24203 /* libavutil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libavutil.framework; sourceTree = "<group>"; };
341D1E6823CA8F3D00B24203 /* mobileffmpeg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = mobileffmpeg.framework; sourceTree = "<group>"; };
341D1E7123CA8F3E00B24203 /* libswresample.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libswresample.framework; sourceTree = "<group>"; };
341D1EB623CA8F8400B24203 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
342900D322DE3AAB0071B2E4 /* MediaInformationParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaInformationParserTest.h; sourceTree = "<group>"; };
342900D522DE3AB30071B2E4 /* MobileFFmpegTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileFFmpegTest.h; sourceTree = "<group>"; };
@@ -102,6 +119,7 @@
34DC789A21215B5800C3486C /* sil_open_font_license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sil_open_font_license.txt; sourceTree = "<group>"; };
34E313FA24A533040004B1D7 /* ConcurrentExecutionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentExecutionViewController.h; sourceTree = "<group>"; };
34E313FB24A533040004B1D7 /* ConcurrentExecutionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConcurrentExecutionViewController.m; sourceTree = "<group>"; };
34F2036A24C31F61003C6973 /* openh264.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = openh264.framework; sourceTree = "<group>"; };
34FAE210209F7DDD005CE2AE /* MobileFFmpegTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MobileFFmpegTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
34FAE213209F7DDD005CE2AE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
34FAE214209F7DDD005CE2AE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -123,9 +141,18 @@
files = (
341D1EB723CA8F8400B24203 /* libiconv.tbd in Frameworks */,
34AE897122AE5A4600742D95 /* GameController.framework in Frameworks */,
341D1EAA23CA8F3F00B24203 /* libswresample.framework in Frameworks */,
34AE897022AE5A3500742D95 /* VideoToolbox.framework in Frameworks */,
34F2036B24C31F61003C6973 /* openh264.framework in Frameworks */,
341D1E8523CA8F3E00B24203 /* libavdevice.framework in Frameworks */,
341D1EA123CA8F3F00B24203 /* mobileffmpeg.framework in Frameworks */,
34AE896F22AE5A2E00742D95 /* CoreMotion.framework in Frameworks */,
341D1E9C23CA8F3F00B24203 /* libavutil.framework in Frameworks */,
341D1E9B23CA8F3F00B24203 /* libavcodec.framework in Frameworks */,
343165D121D136FC001A7185 /* libz.tbd in Frameworks */,
341D1E8F23CA8F3F00B24203 /* libavfilter.framework in Frameworks */,
341D1E8223CA8F3E00B24203 /* libswscale.framework in Frameworks */,
341D1E9423CA8F3F00B24203 /* libavformat.framework in Frameworks */,
3431662B21D13B0A001A7185 /* libc++.tbd in Frameworks */,
343165D321D13704001A7185 /* libbz2.tbd in Frameworks */,
);
@@ -152,12 +179,21 @@
isa = PBXGroup;
children = (
341D1EB623CA8F8400B24203 /* libiconv.tbd */,
341D1E6223CA8F3D00B24203 /* libavcodec.framework */,
341D1E4C23CA8F3C00B24203 /* libavdevice.framework */,
341D1E5623CA8F3C00B24203 /* libavfilter.framework */,
341D1E5B23CA8F3D00B24203 /* libavformat.framework */,
341D1E6323CA8F3D00B24203 /* libavutil.framework */,
341D1E7123CA8F3E00B24203 /* libswresample.framework */,
341D1E4923CA8F3C00B24203 /* libswscale.framework */,
341D1E6823CA8F3D00B24203 /* mobileffmpeg.framework */,
3431662E21D13C58001A7185 /* CoreMotion.framework */,
3431662D21D13C4A001A7185 /* GameController.framework */,
3431662C21D13C3D001A7185 /* VideoToolbox.framework */,
3431662A21D13B0A001A7185 /* libc++.tbd */,
343165D221D13704001A7185 /* libbz2.tbd */,
343165D021D136FC001A7185 /* libz.tbd */,
34F2036A24C31F61003C6973 /* openh264.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -485,7 +521,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 44;
DEVELOPMENT_TEAM = 98GD5J4999;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -512,7 +548,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 44;
DEVELOPMENT_TEAM = 98GD5J4999;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
+49 -22
View File
@@ -1,5 +1,5 @@
#!/bin/bash
#
#
# Creates a new android release from current branch
#
@@ -10,83 +10,110 @@ export GPL_PACKAGES="--enable-gpl --enable-libvidstab --enable-x264 --enable-x26
export FULL_PACKAGES="--enable-fontconfig --enable-freetype --enable-fribidi --enable-gmp --enable-gnutls --enable-kvazaar --enable-lame --enable-libaom --enable-libass --enable-libiconv --enable-libilbc --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-opencore-amr --enable-opus --enable-shine --enable-snappy --enable-soxr --enable-speex --enable-twolame --enable-vo-amrwbenc --enable-wavpack"
create_package() {
local NEW_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg-$1-$2.LTS.aar"
local NEW_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg-$1-$2.LTS.aar"
local CURRENT_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg.aar"
rm -f ${NEW_PACKAGE}
local CURRENT_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg.aar"
rm -f ${NEW_PACKAGE}
mv ${CURRENT_PACKAGE} ${NEW_PACKAGE} || exit 1
mv ${CURRENT_PACKAGE} ${NEW_PACKAGE} || exit 1
}
enable_gradle_build() {
rm -f ${BASEDIR}/../../android/app/build.gradle || exit 1
cp ${BASEDIR}/android/build.gradle ${BASEDIR}/../../android/app/build.gradle || exit 1
}
enable_gradle_release() {
rm -f ${BASEDIR}/../../android/app/build.gradle || exit 1
cp ${BASEDIR}/android/release.template.gradle ${BASEDIR}/../../android/app/build.gradle || exit 1
}
if [ $# -ne 2 ]; then
echo "Usage: android.sh <version code> <version name>"
exit 1
echo "Usage: android.sh <version code> <version name>"
exit 1
fi
# VALIDATE VERSIONS
MOBILE_FFMPEG_VERSION=$(grep '#define MOBILE_FFMPEG_VERSION' ${BASEDIR}/../../android/app/src/main/cpp/mobileffmpeg.h | grep -Eo '\".*\"' | sed -e 's/\"//g')
if [[ "${MOBILE_FFMPEG_VERSION}" != "$2" ]]; then
echo "Error: version mismatch. v$2 requested but v${MOBILE_FFMPEG_VERSION} found. Please perform the following updates and try again."
echo "1. Update docs"
echo "2. Update android/app/build.gradle file versions"
echo "3. Update tools/release scripts' descriptions"
echo "4. Update mobileffmpeg.h versions for both android and ios"
echo "5. Update versions in Doxyfile"
exit 1
echo "Error: version mismatch. v$2 requested but v${MOBILE_FFMPEG_VERSION} found. Please perform the following updates and try again."
echo "1. Update docs"
echo "2. Update android/app/build.gradle file versions"
echo "3. Update tools/release scripts' descriptions"
echo "4. Update mobileffmpeg.h versions for both android and ios"
echo "5. Update versions in Doxyfile"
exit 1
fi
# MIN RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-min -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 without any external libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-min -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 without any external libraries enabled.' clean install bintrayUpload || exit 1
create_package "min" "$2" || exit 1
# MIN-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-min-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-min-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "min-gpl" "$2" || exit 1
# HTTPS RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-gnutls --enable-gmp || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-https -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0 and gnutls v3.6.13 library enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-https -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0 and gnutls v3.6.13 library enabled.' clean install bintrayUpload || exit 1
create_package "https" "$2" || exit 1
# HTTPS-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-gnutls --enable-gmp ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-https-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0, gnutls v3.6.13, libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-https-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0, gnutls v3.6.13, libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "https-gpl" "$2" || exit 1
# AUDIO RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-lame --enable-libilbc --enable-libvorbis --enable-opencore-amr --enable-opus --enable-shine --enable-soxr --enable-speex --enable-twolame --enable-vo-amrwbenc --enable-wavpack || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-audio -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with lame v3.100, libilbc v2.0.2, libvorbis v1.3.7, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-audio -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with lame v3.100, libilbc v2.0.2, libvorbis v1.3.7, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "audio" "$2" || exit 1
# VIDEO RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-fontconfig --enable-freetype --enable-fribidi --enable-kvazaar --enable-libaom --enable-libass --enable-libiconv --enable-libtheora --enable-libvpx --enable-snappy --enable-libwebp || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-video -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, kvazaar v2.0.0, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libtheora v1.1.1, libvpx v1.8.2, snappy v1.1.8 and libwebp v1.1.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-video -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, kvazaar v2.0.0, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libtheora v1.1.1, libvpx v1.8.2, snappy v1.1.8 and libwebp v1.1.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "video" "$2" || exit 1
# FULL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${FULL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-full -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-full -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "full" "$2" || exit 1
# FULL-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${FULL_PACKAGES} ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-full-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvid.stab v1.1.0, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3, wavpack v5.3.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2.LTS -PreleaseMinSdk=16 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-full-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvid.stab v1.1.0, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3, wavpack v5.3.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "full-gpl" "$2" || exit 1
enable_gradle_build
+49 -23
View File
@@ -1,5 +1,5 @@
#!/bin/bash
#
#
# Creates a new android release from current branch
#
@@ -10,84 +10,110 @@ export GPL_PACKAGES="--enable-gpl --enable-libvidstab --enable-x264 --enable-x26
export FULL_PACKAGES="--enable-fontconfig --enable-freetype --enable-fribidi --enable-gmp --enable-gnutls --enable-kvazaar --enable-lame --enable-libaom --enable-libass --enable-libiconv --enable-libilbc --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-opencore-amr --enable-opus --enable-shine --enable-snappy --enable-soxr --enable-speex --enable-twolame --enable-vo-amrwbenc --enable-wavpack"
create_package() {
local NEW_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg-$1-$2.aar"
local NEW_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg-$1-$2.aar"
local CURRENT_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg.aar"
rm -f ${NEW_PACKAGE}
local CURRENT_PACKAGE="${PACKAGE_DIRECTORY}/mobile-ffmpeg.aar"
rm -f ${NEW_PACKAGE}
mv ${CURRENT_PACKAGE} ${NEW_PACKAGE} || exit 1
mv ${CURRENT_PACKAGE} ${NEW_PACKAGE} || exit 1
}
enable_gradle_build() {
rm -f ${BASEDIR}/../../android/app/build.gradle || exit 1
cp ${BASEDIR}/android/build.gradle ${BASEDIR}/../../android/app/build.gradle || exit 1
}
enable_gradle_release() {
rm -f ${BASEDIR}/../../android/app/build.gradle || exit 1
cp ${BASEDIR}/android/release.template.gradle ${BASEDIR}/../../android/app/build.gradle || exit 1
}
if [ $# -ne 2 ]; then
echo "Usage: android.sh <version code> <version name>"
exit 1
echo "Usage: android.sh <version code> <version name>"
exit 1
fi
# VALIDATE VERSIONS
MOBILE_FFMPEG_VERSION=$(grep '#define MOBILE_FFMPEG_VERSION' ${BASEDIR}/../../android/app/src/main/cpp/mobileffmpeg.h | grep -Eo '\".*\"' | sed -e 's/\"//g')
if [[ "${MOBILE_FFMPEG_VERSION}" != "$2" ]]; then
echo "Error: version mismatch. v$2 requested but v${MOBILE_FFMPEG_VERSION} found. Please perform the following updates and try again."
echo "1. Update docs"
echo "2. Update android/app/build.gradle file versions"
echo "3. Update tools/release scripts' descriptions"
echo "4. Update mobileffmpeg.h versions for both android and ios"
echo "5. Update versions in Doxyfile"
exit 1
echo "Error: version mismatch. v$2 requested but v${MOBILE_FFMPEG_VERSION} found. Please perform the following updates and try again."
echo "1. Update docs"
echo "2. Update android/app/build.gradle file versions"
echo "3. Update tools/release scripts' descriptions"
echo "4. Update mobileffmpeg.h versions for both android and ios"
echo "5. Update versions in Doxyfile"
exit 1
fi
# MIN RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-min -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 without any external libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-min -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 without any external libraries enabled.' clean install bintrayUpload || exit 1
create_package "min" "$2" || exit 1
# MIN-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-min-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-min-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "min-gpl" "$2" || exit 1
# HTTPS RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-gnutls --enable-gmp || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-https -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0 and gnutls v3.6.13 library enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-https -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0 and gnutls v3.6.13 library enabled.' clean install bintrayUpload || exit 1
create_package "https" "$2" || exit 1
# HTTPS-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-gnutls --enable-gmp ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-https-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0, gnutls v3.6.13, libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-https-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with gmp v6.2.0, gnutls v3.6.13, libvid.stab v1.1.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "https-gpl" "$2" || exit 1
# AUDIO RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-lame --enable-libilbc --enable-libvorbis --enable-opencore-amr --enable-opus --enable-shine --enable-soxr --enable-speex --enable-twolame --enable-vo-amrwbenc --enable-wavpack || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-audio -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with lame v3.100, libilbc v2.0.2, libvorbis v1.3.7, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-audio -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with lame v3.100, libilbc v2.0.2, libvorbis v1.3.7, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "audio" "$2" || exit 1
# VIDEO RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} --enable-fontconfig --enable-freetype --enable-fribidi --enable-kvazaar --enable-libaom --enable-libass --enable-libiconv --enable-libtheora --enable-libvpx --enable-snappy --enable-libwebp || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-video -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, kvazaar v2.0.0, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libtheora v1.1.1, libvpx v1.8.2, snappy v1.1.8 and libwebp v1.1.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-video -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, kvazaar v2.0.0, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libtheora v1.1.1, libvpx v1.8.2, snappy v1.1.8 and libwebp v1.1.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "video" "$2" || exit 1
# FULL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${FULL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-full -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-full -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3 and wavpack v5.3.0 libraries enabled.' clean install bintrayUpload || exit 1
create_package "full" "$2" || exit 1
# FULL-GPL RELEASE
enable_gradle_build
cd ${BASEDIR}/../.. || exit 1
./android.sh ${CUSTOM_OPTIONS} ${FULL_PACKAGES} ${GPL_PACKAGES} || exit 1
cd ${BASEDIR}/../../android/app || exit 1
gradle -p ${BASEDIR}/../../android/app -DreleaseMobileFFmpeg=true -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=30 -PreleaseProject=mobile-ffmpeg-full-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvid.stab v1.1.0, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3, wavpack v5.3.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 uploadArchives || exit 1
enable_gradle_release
gradle -p ${BASEDIR}/../../android/app -PreleaseVersionCode=$1 -PreleaseVersionName=$2 -PreleaseMinSdk=24 -PreleaseTargetSdk=29 -PreleaseProject=mobile-ffmpeg-full-gpl -PreleaseProjectDescription='Includes FFmpeg v4.4-dev-416 with fontconfig v2.13.92, freetype v2.10.2, fribidi v1.0.9, gmp v6.2.0, gnutls v3.6.13, kvazaar v2.0.0, lame v3.100, libaom v1.0.0-errata1-avif-110, libass v0.14.0, libiconv v1.16, libilbc v2.0.2, libtheora v1.1.1, libvid.stab v1.1.0, libvorbis v1.3.7, libvpx v1.8.2, libwebp v1.1.0, libxml2 v2.9.10, opencore-amr v0.1.5, opus v1.3.1, shine v3.1.1, snappy v1.1.8, soxr v0.1.3, speex v1.2.0, twolame v0.4, vo-amrwbenc v0.1.3, wavpack v5.3.0, x264 v20200630-stable, x265 v3.4 and xvidcore v1.3.7 libraries enabled.' -PreleaseGPL=1 clean install bintrayUpload || exit 1
create_package "full-gpl" "$2" || exit 1
enable_gradle_build
+9 -6
View File
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 30
compileSdkVersion 29
ndkVersion "21.3.6528147"
defaultConfig {
minSdkVersion 24
targetSdkVersion 30
targetSdkVersion 29
versionCode 240440
versionName "4.4"
project.archivesBaseName = "mobile-ffmpeg"
@@ -31,11 +31,14 @@ android {
}
}
task javadoc(type: Javadoc) {
title = 'MobileFFmpeg'
destinationDir = file("${projectDir}/../../docs/android/javadoc")
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
source = android.sourceSets.main.java.srcDirs
}
dependencies {
testImplementation "androidx.test.ext:junit:1.1.1"
testImplementation "org.json:json:20190722"
}
if (System.properties.containsKey('releaseMobileFFmpeg')) {
apply from: "${rootProject.projectDir}/../tools/release/android/release.template.gradle"
}
+9 -6
View File
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 30
compileSdkVersion 29
ndkVersion "21.3.6528147"
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 29
versionCode 160440
versionName "4.4.LTS"
project.archivesBaseName = "mobile-ffmpeg"
@@ -31,11 +31,14 @@ android {
}
}
task javadoc(type: Javadoc) {
title = 'MobileFFmpeg'
destinationDir = file("${projectDir}/../../docs/android/javadoc")
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
source = android.sourceSets.main.java.srcDirs
}
dependencies {
testImplementation "androidx.test.ext:junit:1.1.1"
testImplementation "org.json:json:20190722"
}
if (System.properties.containsKey('releaseMobileFFmpeg')) {
apply from: "${rootProject.projectDir}/../tools/release/android/release.template.gradle"
}
+152 -79
View File
@@ -1,3 +1,149 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
android {
compileSdkVersion Integer.parseInt(releaseTargetSdk)
ndkVersion "21.3.6528147"
defaultConfig {
minSdkVersion Integer.parseInt(releaseMinSdk)
targetSdkVersion Integer.parseInt(releaseTargetSdk)
versionCode Integer.parseInt(releaseVersionCode)
versionName releaseVersionName
project.archivesBaseName = releaseProject
consumerProguardFiles 'proguard-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ["../libs"]
}
}
testOptions {
unitTests.returnDefaultValues = true
}
libraryVariants.all { variant ->
variant.outputs.all {
outputFileName = "${archivesBaseName}-${android.defaultConfig.versionName}.aar"
}
}
}
ext {
bintrayRepo = 'maven'
bintrayName = releaseProject
publishedGroupId = 'com.arthenica'
libraryName = releaseProject
artifact = releaseProject
libraryDescription = releaseProjectDescription
siteUrl = 'https://github.com/tanersener/mobile-ffmpeg'
issueTrackerUrl = 'https://github.com/tanersener/mobile-ffmpeg/issues'
gitUrl = 'https://github.com/tanersener/mobile-ffmpeg.git'
libraryVersion = releaseVersionName
developerId = 'tanersener'
developerName = 'Taner Sener'
developerEmail = 'tanersener@gmail.com'
if (Project.hasProperty('releaseGPL')) {
licenseName = 'GNU General Public License version 3'
licenseUrl = 'https://www.gnu.org/licenses/gpl-3.0.txt'
allLicenses = ["GPL-3.0"]
} else {
licenseName = 'GNU Lesser General Public License, Version 3'
licenseUrl = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
allLicenses = ["LGPL-3.0"]
}
}
group = publishedGroupId
version = libraryVersion
install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
name libraryName
description libraryDescription
url siteUrl
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
issueTrackerUrl = issueTrackerUrl
licenses = allLicenses
dryRun = true
publish = false
override = false
publicDownloadNumbers = false
version {
desc = libraryDescription
}
}
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
@@ -19,87 +165,14 @@ artifacts {
archives sourcesJar
}
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.arthenica'
archivesBaseName = releaseProject
version = releaseVersionName
File propertiesFile = project.rootProject.file('local.properties')
if (propertiesFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(propertiesFile))
properties.each { name, value ->
ext[name] = value
}
dependencies {
testImplementation "androidx.test.ext:junit:1.1.1"
testImplementation "org.json:json:20190722"
}
ext {
publishedGroupId = group
artifact = releaseProject
libraryName = releaseProject
libraryVersion = version
libraryDescription = releaseProjectDescription
siteUrl = 'https://github.com/tanersener/mobile-ffmpeg'
gitUrl = 'https://github.com/tanersener/mobile-ffmpeg.git'
developerId = 'tanersener'
developerName = 'Taner Sener'
developerEmail = 'tanersener@gmail.com'
if (Project.hasProperty('releaseGPL')) {
licenseName = 'GNU General Public License version 3'
licenseUrl = 'https://www.gnu.org/licenses/gpl-3.0.txt'
} else {
licenseName = 'GNU Lesser General Public License, Version 3'
licenseUrl = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
}
}
uploadArchives {
allprojects {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
packaging 'aar'
name = libraryName
description = libraryDescription
url = siteUrl
licenses {
license {
name = licenseName
url = licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
google()
jcenter()
}
}
signing {
sign configurations.archives
}