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 #48 from arthenica/development
Browse files Browse the repository at this point in the history
merge v6.0 applications to main
  • Loading branch information
tanersener authored Aug 24, 2023
2 parents 52f6be0 + 2ae636c commit 1551c35
Show file tree
Hide file tree
Showing 62 changed files with 207 additions and 188 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Test applications are tagged with `ffmpeg-kit` release they depend on.

| Platform | FFmpegKit Version | Tag |
| :----: |:-----------------:|:---------------------------------------------------------------------------------:|
| Android | 6.0 | [6.0](https://github.com/arthenica/ffmpeg-kit-test/tree/android.v6.0) |
| Android | 6.0.LTS | [6.0.LTS](https://github.com/arthenica/ffmpeg-kit-test/tree/android.v6.0.lts) |
| iOS | 6.0 | [6.0](https://github.com/arthenica/ffmpeg-kit-test/tree/ios.v6.0) |
| iOS | 6.0.LTS | [6.0.LTS](https://github.com/arthenica/ffmpeg-kit-test/tree/ios.v6.0.lts) |
| macOS | 6.0 | [6.0](https://github.com/arthenica/ffmpeg-kit-test/tree/macos.v6.0) |
| macOS | 6.0.LTS | [6.0.LTS](https://github.com/arthenica/ffmpeg-kit-test/tree/macos.v6.0.lts) |
| tvOS | 6.0 | [6.0](https://github.com/arthenica/ffmpeg-kit-test/tree/tvos.v6.0) |
| tvOS | 6.0.LTS | [6.0.LTS](https://github.com/arthenica/ffmpeg-kit-test/tree/tvos.v6.0.lts) |
| - | - | - |
| React Native | 5.1.0 | [5.1.0](https://github.com/arthenica/ffmpeg-kit-test/tree/react.native.v5.1.0) |
| Flutter | 5.1.0 | [5.1.0](https://github.com/arthenica/ffmpeg-kit-test/tree/flutter.v5.1.0) |
| Flutter | 5.1.0-LTS | [5.1.0-LTS](https://github.com/arthenica/ffmpeg-kit-test/tree/flutter.v5.1.0.lts) |
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:8.1.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 8 additions & 6 deletions android/test-app-local-dependency/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ android {
keyPassword 'android'
}
}
namespace 'com.arthenica.ffmpegkit.test'
compileSdk 31
if (project.android.hasProperty("namespace")) {
namespace 'com.arthenica.ffmpegkit.test'
}
compileSdk 33
defaultConfig {
applicationId "com.arthenica.ffmpegkit.test"
minSdk 24
targetSdk 31
versionCode 240510
versionName "5.1"
targetSdk 33
versionCode 240600
versionName "6.0"
}
buildTypes {
debug {
Expand Down Expand Up @@ -55,6 +57,6 @@ 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.2.1'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static String generateCreateVideoWithPipesScript(final String image1Pipe, final
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
" -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr -c:v mpeg4 -r 30 " + videoFilePath;
}

static String generateEncodeVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath, final String videoCodec, final String customOptions) {
Expand All @@ -74,7 +74,7 @@ static String generateEncodeVideoScript(final String image1Path, final String im
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=" + pixelFormat + "[video]\"" +
" -map [video] -vsync 2 -async 1 " + customOptions + "-c:v " + videoCodec.toLowerCase(Locale.ENGLISH) + " -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr " + customOptions + "-c:v " + videoCodec.toLowerCase(Locale.ENGLISH) + " -r 30 " + videoFilePath;
}

static String generateShakingVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath) {
Expand All @@ -94,7 +94,7 @@ static String generateShakingVideoScript(final String image1Path, final String i
"[3:v][stream2overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream2shaking];" +
"[3:v][stream3overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream3shaking];" +
"[stream1shaking][stream2shaking][stream3shaking]concat=n=3:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
" -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr -c:v mpeg4 -r 30 " + videoFilePath;
}

static String generateZscaleVideoScript(final String inputVideoFilePath, final String outputVideoFilePath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public String getSelectedVideoCodec() {
case "x264":
videoCodec = "libx264";
break;
case "h264_mediacodec":
videoCodec = "h264_mediacodec";
break;
case "hevc_mediacodec":
videoCodec = "hevc_mediacodec";
break;
case "openh264":
videoCodec = "libopenh264";
break;
Expand Down Expand Up @@ -292,7 +298,7 @@ public File getVideoFile() {
break;
default:

// mpeg4, x264, x265, xvid, kvazaar
// mpeg4, x264, h264_mediacodec, hevc_mediacodec, x265, xvid, kvazaar
extension = "mp4";
break;
}
Expand All @@ -319,7 +325,7 @@ public String getCustomOptions() {
return "-format hap_q ";
default:

// kvazaar, mpeg4, x264, xvid
// kvazaar, mpeg4, x264, h264_mediacodec, hevc_mediacodec, xvid
return "";
}
}
Expand All @@ -344,7 +350,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<string-array name="video_codec">
<item>mpeg4</item>
<item>x264</item>
<item>h264_mediacodec</item>
<item>hevc_mediacodec</item>
<item>openh264</item>
<item>x265</item>
<item>xvid</item>
Expand Down
16 changes: 9 additions & 7 deletions android/test-app-maven-central/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ android {
keyPassword 'android'
}
}
namespace 'com.arthenica.ffmpegkit.test'
compileSdk 31
if (project.android.hasProperty("namespace")) {
namespace 'com.arthenica.ffmpegkit.test'
}
compileSdk 33
defaultConfig {
applicationId "com.arthenica.ffmpegkit.test"
minSdk 24
targetSdk 31
versionCode 240510
versionName "5.1"
targetSdk 33
versionCode 240600
versionName "6.0"
}
buildTypes {
debug {
Expand Down Expand Up @@ -52,7 +54,7 @@ android.applicationVariants.all { variant ->
}

dependencies {
implementation 'com.arthenica:ffmpeg-kit-full:5.1'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.arthenica:ffmpeg-kit-full:6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static String generateCreateVideoWithPipesScript(final String image1Pipe, final
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
" -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr -c:v mpeg4 -r 30 " + videoFilePath;
}

static String generateEncodeVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath, final String videoCodec, final String customOptions) {
Expand All @@ -74,7 +74,7 @@ static String generateEncodeVideoScript(final String image1Path, final String im
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=" + pixelFormat + "[video]\"" +
" -map [video] -vsync 2 -async 1 " + customOptions + "-c:v " + videoCodec.toLowerCase(Locale.ENGLISH) + " -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr " + customOptions + "-c:v " + videoCodec.toLowerCase(Locale.ENGLISH) + " -r 30 " + videoFilePath;
}

static String generateShakingVideoScript(final String image1Path, final String image2Path, final String image3Path, final String videoFilePath) {
Expand All @@ -94,7 +94,7 @@ static String generateShakingVideoScript(final String image1Path, final String i
"[3:v][stream2overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream2shaking];" +
"[3:v][stream3overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream3shaking];" +
"[stream1shaking][stream2shaking][stream3shaking]concat=n=3:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
" -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + videoFilePath;
" -map [video] -fps_mode cfr -c:v mpeg4 -r 30 " + videoFilePath;
}

static String generateZscaleVideoScript(final String inputVideoFilePath, final String outputVideoFilePath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public String getSelectedVideoCodec() {
case "x264":
videoCodec = "libx264";
break;
case "h264_mediacodec":
videoCodec = "h264_mediacodec";
break;
case "hevc_mediacodec":
videoCodec = "hevc_mediacodec";
break;
case "openh264":
videoCodec = "libopenh264";
break;
Expand Down Expand Up @@ -292,7 +298,7 @@ public File getVideoFile() {
break;
default:

// mpeg4, x264, x265, xvid, kvazaar
// mpeg4, x264, h264_mediacodec, hevc_mediacodec, x265, xvid, kvazaar
extension = "mp4";
break;
}
Expand All @@ -319,7 +325,7 @@ public String getCustomOptions() {
return "-format hap_q ";
default:

// kvazaar, mpeg4, x264, xvid
// kvazaar, mpeg4, x264, h264_mediacodec, hevc_mediacodec, xvid
return "";
}
}
Expand All @@ -344,7 +350,7 @@ protected void updateProgressDialog() {
return;
}

int timeInMilliseconds = this.statistics.getTime();
double timeInMilliseconds = this.statistics.getTime();
int totalVideoDuration = 9000;

String completePercentage = new BigDecimal(timeInMilliseconds).multiply(new BigDecimal(100)).divide(new BigDecimal(totalVideoDuration), 0, BigDecimal.ROUND_HALF_UP).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<string-array name="video_codec">
<item>mpeg4</item>
<item>x264</item>
<item>h264_mediacodec</item>
<item>hevc_mediacodec</item>
<item>openh264</item>
<item>x265</item>
<item>xvid</item>
Expand Down
12 changes: 5 additions & 7 deletions ios/test-app-cocoapods/FFmpegKitIOS/FFmpegKitTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
}

void testParseSimpleCommand() {
NSArray *argumentArray = parseArguments(@"-hide_banner -loop 1 -i file.jpg -filter_complex [0:v]setpts=PTS-STARTPTS[video] -map [video] -vsync 2 -async 1 video.mp4");
NSArray *argumentArray = parseArguments(@"-hide_banner -loop 1 -i file.jpg -filter_complex [0:v]setpts=PTS-STARTPTS[video] -map [video] -fps_mode cfr video.mp4");

assert(argumentArray != nil);
assertNumber([[NSNumber alloc] initWithInt:14], [[NSNumber alloc] initWithUnsignedLong: [argumentArray count]]);
assertNumber([[NSNumber alloc] initWithInt:12], [[NSNumber alloc] initWithUnsignedLong: [argumentArray count]]);

assertString(@"-hide_banner", argumentArray[0]);
assertString(@"-loop", argumentArray[1]);
Expand All @@ -91,11 +91,9 @@ void testParseSimpleCommand() {
assertString(@"[0:v]setpts=PTS-STARTPTS[video]", argumentArray[6]);
assertString(@"-map", argumentArray[7]);
assertString(@"[video]", argumentArray[8]);
assertString(@"-vsync", argumentArray[9]);
assertString(@"2", argumentArray[10]);
assertString(@"-async", argumentArray[11]);
assertString(@"1", argumentArray[12]);
assertString(@"video.mp4", argumentArray[13]);
assertString(@"-fps_mode", argumentArray[9]);
assertString(@"cfr", argumentArray[10]);
assertString(@"video.mp4", argumentArray[11]);
}

void testParseSingleQuotesInCommand() {
Expand Down
2 changes: 1 addition & 1 deletion ios/test-app-cocoapods/FFmpegKitIOS/PipeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ - (void)updateProgressDialog {
}

if (alertController != nil) {
int timeInMilliseconds = [statistics getTime];
double timeInMilliseconds = [statistics getTime];
int totalVideoDuration = 9000;

int percentage = timeInMilliseconds*100/totalVideoDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ - (void)updateProgressDialog {
}

if (alertController != nil) {
int timeInMilliseconds = [statistics getTime];
double timeInMilliseconds = [statistics getTime];
int totalVideoDuration = 9000;

int percentage = timeInMilliseconds*100/totalVideoDuration;
Expand Down
Loading

0 comments on commit 1551c35

Please sign in to comment.