Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Merge pull request #12 from tanersener/development
Browse files Browse the repository at this point in the history
merge v4.5.1 native test applications
  • Loading branch information
tanersener authored Dec 31, 2021
2 parents eb2a863 + 9c30b27 commit 70ed6f0
Show file tree
Hide file tree
Showing 217 changed files with 2,215 additions and 7,911 deletions.
53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,37 @@ demonstrate how SAF uris can be used with `FFmpegKit`.

Test applications are tagged with `ffmpeg-kit` release they depend on.

| Platform | FFmpegKit Version | Tag|
| :----: | :----: |:----: |
| Flutter | 4.5.0 | [4.5.0](https://github.com/tanersener/ffmpeg-kit-test/tree/flutter.v4.5.0) |
| Flutter | 4.5.0-LTS | [4.5.0-LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/flutter.v4.5.0.lts) |
| React Native | 4.5.0 | [4.5.0](https://github.com/tanersener/ffmpeg-kit-test/tree/react.native.v4.5.0) |
| Android | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5) |
| Android | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5.lts) |
| iOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5) |
| iOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5.lts) |
| macOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5) |
| macOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5.lts) |
| tvOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5) |
| tvOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5.lts) |
| - | - | - |
| Android | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.4) |
| Android | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.4.lts) |
| iOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.4) |
| iOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.4.lts) |
| macOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.4) |
| macOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.4.lts) |
| tvOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.4) |
| tvOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.4.lts) |
| Platform | FFmpegKit Version | Tag|
| :----: |:-----------------:|:----: |
| Android | 4.5.1 | [4.5.1](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5.1) |
| Android | 4.5.1.LTS | [4.5.1.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5.1.lts) |
| iOS | 4.5.1 | [4.5.1](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5.1) |
| iOS | 4.5.1.LTS | [4.5.1.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5.1.lts) |
| macOS | 4.5.1 | [4.5.1](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5.1) |
| macOS | 4.5.1.LTS | [4.5.1.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5.1.lts) |
| tvOS | 4.5.1 | [4.5.1](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5.1) |
| tvOS | 4.5.1.LTS | [4.5.1.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5.1.lts) |
| - | - | - |
| Flutter | 4.5.0 | [4.5.0](https://github.com/tanersener/ffmpeg-kit-test/tree/flutter.v4.5.0) |
| Flutter | 4.5.0-LTS | [4.5.0-LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/flutter.v4.5.0.lts) |
| React Native | 4.5.0 | [4.5.0](https://github.com/tanersener/ffmpeg-kit-test/tree/react.native.v4.5.0) |
| Android | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5) |
| Android | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.5.lts) |
| iOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5) |
| iOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.5.lts) |
| macOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5) |
| macOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.5.lts) |
| tvOS | 4.5 | [4.5](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5) |
| tvOS | 4.5.LTS | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.5.lts) |
| - | - | - |
| Android | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.4) |
| Android | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/android.v4.4.lts) |
| iOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.4) |
| iOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/ios.v4.4.lts) |
| macOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.4) |
| macOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/macos.v4.4.lts) |
| tvOS | 4.4 | [4.4](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.4) |
| tvOS | 4.4.LTS | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit-test/tree/tvos.v4.4.lts) |

### License

Expand Down
6 changes: 3 additions & 3 deletions android/test-app-local-dependency/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.arthenica.ffmpegkit.test"
minSdkVersion 24
targetSdkVersion 30
versionCode 240450
versionName "4.5"
versionCode 240451
versionName "4.5.1"
}
buildTypes {
debug {
Expand Down Expand Up @@ -53,7 +53,7 @@ android.applicationVariants.all { variant ->
dependencies {
// implementation files('../../../ffmpeg-kit/prebuilt/bundle-android-aar-lts/ffmpeg-kit/ffmpeg-kit.aar')
implementation files('../../../ffmpeg-kit/prebuilt/bundle-android-aar/ffmpeg-kit/ffmpeg-kit.aar')
implementation 'com.arthenica:smart-exception-java:0.1.0'
implementation 'com.arthenica:smart-exception-java:0.1.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

package com.arthenica.ffmpegkit.test;

import static com.arthenica.ffmpegkit.test.MainActivity.TAG;
import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
Expand All @@ -36,21 +39,16 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;

import com.arthenica.ffmpegkit.ExecuteCallback;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.arthenica.ffmpegkit.FFmpegKitConfig;
import com.arthenica.ffmpegkit.FFmpegSession;
import com.arthenica.ffmpegkit.FFmpegSessionCompleteCallback;
import com.arthenica.ffmpegkit.LogCallback;
import com.arthenica.ffmpegkit.ReturnCode;
import com.arthenica.ffmpegkit.Session;
import com.arthenica.ffmpegkit.SessionState;
import com.arthenica.ffmpegkit.util.DialogUtil;

import java.io.File;
import java.util.concurrent.Callable;

import static com.arthenica.ffmpegkit.test.MainActivity.TAG;
import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

public class AudioTabFragment extends Fragment implements AdapterView.OnItemSelectedListener {
private AlertDialog progressDialog;
Expand Down Expand Up @@ -105,12 +103,11 @@ public void enableLogCallback() {

@Override
public void apply(final com.arthenica.ffmpegkit.Log log) {
MainActivity.addUIAction(new Callable<Object>() {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
appendOutput(log.getMessage());
return null;
}
});
}
Expand Down Expand Up @@ -153,28 +150,26 @@ public void encodeAudio() {

android.util.Log.d(TAG, String.format("FFmpeg process started with arguments\n'%s'.", ffmpegCommand));

FFmpegKit.executeAsync(ffmpegCommand, new ExecuteCallback() {
FFmpegKit.executeAsync(ffmpegCommand, new FFmpegSessionCompleteCallback() {

@Override
public void apply(final Session session) {
public void apply(final FFmpegSession session) {
final SessionState state = session.getState();
final ReturnCode returnCode = session.getReturnCode();

hideProgressDialog();

MainActivity.addUIAction(new Callable<Object>() {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
if (ReturnCode.isSuccess(returnCode)) {
Popup.show(requireContext(), "Encode completed successfully.");
android.util.Log.d(TAG, "Encode completed successfully.");
} else {
Popup.show(requireContext(), "Encode failed. Please check logs for the details.");
android.util.Log.d(TAG, String.format("Encode failed with state %s and rc %s.%s", state, returnCode, notNull(session.getFailStackTrace(), "\n")));
}

return null;
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

package com.arthenica.ffmpegkit.test;

import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.util.AndroidRuntimeException;
Expand All @@ -34,20 +36,17 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.arthenica.ffmpegkit.ExecuteCallback;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.arthenica.ffmpegkit.FFmpegKitConfig;
import com.arthenica.ffmpegkit.FFmpegSession;
import com.arthenica.ffmpegkit.FFmpegSessionCompleteCallback;
import com.arthenica.ffmpegkit.FFprobeSession;
import com.arthenica.ffmpegkit.FFprobeSessionCompleteCallback;
import com.arthenica.ffmpegkit.LogCallback;
import com.arthenica.ffmpegkit.LogRedirectionStrategy;
import com.arthenica.ffmpegkit.ReturnCode;
import com.arthenica.ffmpegkit.Session;
import com.arthenica.ffmpegkit.SessionState;

import java.util.concurrent.Callable;

import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

public class CommandTabFragment extends Fragment {
private EditText commandText;
private TextView outputText;
Expand Down Expand Up @@ -105,22 +104,21 @@ public void runFFmpeg() {

android.util.Log.d(MainActivity.TAG, String.format("FFmpeg process started with arguments:\n'%s'", ffmpegCommand));

FFmpegKit.executeAsync(ffmpegCommand, new ExecuteCallback() {
FFmpegKit.executeAsync(ffmpegCommand, new FFmpegSessionCompleteCallback() {

@Override
public void apply(final Session session) {
public void apply(final FFmpegSession session) {
final SessionState state = session.getState();
final ReturnCode returnCode = session.getReturnCode();

android.util.Log.d(MainActivity.TAG, String.format("FFmpeg process exited with state %s and rc %s.%s", state, returnCode, notNull(session.getFailStackTrace(), "\n")));
android.util.Log.d(MainActivity.TAG, String.format("FFmpeg process exited with state %s and rc %s.%s", FFmpegKitConfig.sessionStateToString(state), returnCode, notNull(session.getFailStackTrace(), "\n")));

if (state == SessionState.FAILED || !returnCode.isSuccess()) {
MainActivity.addUIAction(new Callable<Object>() {
if (state == SessionState.FAILED || !returnCode.isValueSuccess()) {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
Popup.show(requireContext(), "Command failed. Please check output for the details.");
return null;
}
});
}
Expand All @@ -129,12 +127,11 @@ public Object call() {

@Override
public void apply(final com.arthenica.ffmpegkit.Log log) {
MainActivity.addUIAction(new Callable<Object>() {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
appendOutput(log.getMessage());
return null;
}
});

Expand All @@ -152,31 +149,29 @@ public void runFFprobe() {

android.util.Log.d(MainActivity.TAG, String.format("FFprobe process started with arguments:\n'%s'", ffprobeCommand));

FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(ffprobeCommand), new ExecuteCallback() {
FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(ffprobeCommand), new FFprobeSessionCompleteCallback() {

@Override
public void apply(final Session session) {
public void apply(final FFprobeSession session) {
final SessionState state = session.getState();
final ReturnCode returnCode = session.getReturnCode();

MainActivity.addUIAction(new Callable<Object>() {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
appendOutput(session.getOutput());
return null;
}
});

android.util.Log.d(MainActivity.TAG, String.format("FFprobe process exited with state %s and rc %s.%s", state, returnCode, notNull(session.getFailStackTrace(), "\n")));
android.util.Log.d(MainActivity.TAG, String.format("FFprobe process exited with state %s and rc %s.%s", FFmpegKitConfig.sessionStateToString(state), returnCode, notNull(session.getFailStackTrace(), "\n")));

if (state == SessionState.FAILED || !session.getReturnCode().isSuccess()) {
MainActivity.addUIAction(new Callable<Object>() {
if (state == SessionState.FAILED || !session.getReturnCode().isValueSuccess()) {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
Popup.show(requireContext(), "Command failed. Please check output for the details.");
return null;
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

package com.arthenica.ffmpegkit.test;

import static com.arthenica.ffmpegkit.test.MainActivity.TAG;
import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
Expand All @@ -32,24 +35,19 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.arthenica.ffmpegkit.ExecuteCallback;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.arthenica.ffmpegkit.FFmpegKitConfig;
import com.arthenica.ffmpegkit.FFmpegSession;
import com.arthenica.ffmpegkit.FFmpegSessionCompleteCallback;
import com.arthenica.ffmpegkit.LogCallback;
import com.arthenica.ffmpegkit.ReturnCode;
import com.arthenica.ffmpegkit.Session;
import com.arthenica.ffmpegkit.SessionState;
import com.arthenica.ffmpegkit.util.ResourcesUtil;
import com.arthenica.smartexception.java.Exceptions;

import java.io.File;
import java.io.IOException;
import java.util.Locale;
import java.util.concurrent.Callable;

import static com.arthenica.ffmpegkit.test.MainActivity.TAG;
import static com.arthenica.ffmpegkit.test.MainActivity.notNull;

public class ConcurrentExecutionTabFragment extends Fragment {
private TextView outputText;
Expand Down Expand Up @@ -161,12 +159,11 @@ public void enableLogCallback() {

@Override
public void apply(final com.arthenica.ffmpegkit.Log log) {
MainActivity.addUIAction(new Callable<Object>() {
MainActivity.addUIAction(new Runnable() {

@Override
public Object call() {
public void run() {
appendOutput(String.format(Locale.getDefault(), "%d -> %s", log.getSessionId(), log.getMessage()));
return null;
}
});
}
Expand All @@ -191,10 +188,10 @@ public void encodeVideo(final int buttonNumber) {

Log.d(TAG, String.format("FFmpeg process starting for button %d with arguments\n'%s'.", buttonNumber, ffmpegCommand));

final FFmpegSession session = FFmpegKit.executeAsync(ffmpegCommand, new ExecuteCallback() {
final FFmpegSession session = FFmpegKit.executeAsync(ffmpegCommand, new FFmpegSessionCompleteCallback() {

@Override
public void apply(final Session session) {
public void apply(final FFmpegSession session) {
final SessionState state = session.getState();
final ReturnCode returnCode = session.getReturnCode();

Expand Down
Loading

0 comments on commit 70ed6f0

Please sign in to comment.