Skip to content

Commit

Permalink
1.0.1 minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Kosynkin authored and Ilja Kosynkin committed Oct 3, 2016
1 parent 2747b9b commit a417aae
Show file tree
Hide file tree
Showing 22 changed files with 105 additions and 190 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/dictionaries/Ilja.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

26 changes: 0 additions & 26 deletions .idea/gradle.xml

This file was deleted.

46 changes: 0 additions & 46 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Video processing library based on FFmpeg
## Main purpose
Main purpose of this library is to allow developers to embed FFmpeg into their application with literally one line of code
in gradle.build. Using native code in Java in general and in Android environment especially always related to some problems.
Main purpose of this library is to allow developers to embed FFmpeg into their application with literally one line of code
in gradle.build. Using native code in Java in general and in Android environment especially always related to some problems.
Hopefully VideoKit will resolve some of them.

## Setup
Basic setup just add following line of code to yout gradle.build file:
`compile 'com.infullmobile.android:videokit-release:1.0'`
Also, if you haven't use inFullMobile public maven in your project before, don't forget to add following line to your
Basic setup just add following line of code to your gradle.build file:
`compile 'com.infullmobile.android:videokit-release:1.0.1'`
Also, if you haven't use inFullMobile public maven in your project before, don't forget to add following line to your
repositories:
`maven { url 'https://maven.infullmobile.com/public' }`
That's pretty much all.
That's pretty much all.

## Example usage
Module sample is showing usage of VideoKit. Please note, that VideoKit is basically invoking FFmpeg main() with CLI arguments
Module sample is showing usage of VideoKit. Please note, that VideoKit is basically invoking FFmpeg main() with CLI arguments
so you will use commands almost like you use standard FFmpeg on Linux or Windows or MacOS.
Well, let me show you some code:
```
final VideoKit videoKit = new VideoKit();
final Command command = videoKit.createCommand()
.overwriteOutput()
.addInputPath(path)
.addOutputPath(path + POSTFIX)
.outputPath(path + POSTFIX)
.addCustomCommand("-ss 1 -t 3")
.copyVideoCodec()
.addExperimentalFlag()
.experimentalFlag()
.build();
```
Command is basically set of instructions for FFmpeg. Please note, that order in which you adding instructions in
Command is basically set of instructions for FFmpeg. Please note, that order in which you adding instructions in
CommandBuilder is quite important. Sometimes, when you mess up order, FFmpeg will not recognize command and end up
with error. After you've built a command you should execute it: either with execute() or you can pass it to
with error. After you've built a command you should execute it: either with execute() or you can pass it to
AsyncCommandExecutor.
Please note, that:
`command.execute();`
will be executed on thread on which it was called, while:
`new AsyncCommandExecutor(command, this).execute();`
will be executed in background thread and you have to provide implementation of ProcessingListener to get result of
will be executed in background thread and you have to provide implementation of ProcessingListener to get result of
processing either in onSuccess (you will get path to processed file here) or onFailure (you will get error code here).

## Other functions
Expand All @@ -48,10 +48,19 @@ ERRORS_ONLY
FULL
```

## Error codes
I've tryed to make library as debuggable as it even possible, taking in account that we're working with native code.
## Specific behavior of flags
As I already have mentioned: FFmpeg is quite sensible to the order of flags. To help out with that
to user VideoKit have default behavior for particular flags, namely: input paths, output path and experimental flag.
The order in which VideoKit is laying those flags is following:

1. Input paths are always going first (doesn't matter in which place of chain you have added particular path)
2. Output path is always going at the end of command
3. Experimental flag is always just before output path

## Error codes
I've tried to make library as debuggable as it even possible, taking in account that we're working with native code.
If you getting failures from VideoKit and log in not really helpfull try to look into *docs* folder in *ffmpeg_return_codes*
file. In this file you not only have list of possible return codes with which FFMpeg can exit, but also file and number of
file. In this file you not only have list of possible return codes with which FFMpeg can exit, but also file and number of
line of code in which exit was called.
Version of FFmpeg is 2.8.4 and changed sources can be found over here:
[Development Kit](https://github.com/IljaKosynkin/FFmpeg-Development-Kit)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ buildscript {
repositories {
mavenCentral()
}
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.android.tools.build:gradle:2.2.0'
}
}

allprojects {
repositories {
mavenLocal()
jcenter()
mavenLocal()
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Mon Oct 03 06:57:42 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "ffmpeg.videokit.sample"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
Expand All @@ -25,6 +25,6 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile project(':videokit')
//compile 'com.infullmobile.android:video-kit-ffmpeg:1.0'
//compile 'com.infullmobile.android:videokit-release:1.0.1'
}

4 changes: 2 additions & 2 deletions sample/src/main/java/ffmpeg/videokit/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ public void onMediaFileSelected(String path) {
final Command command = videoKit.createCommand()
.overwriteOutput()
.addInputPath(path)
.addOutputPath(path + POSTFIX)
.outputPath(path + POSTFIX)
.addCustomCommand("-ss 1 -t 3")
.copyVideoCodec()
.addExperimentalFlag()
.experimentalFlag()
.build();

new AsyncCommandExecutor(command, this).execute();
Expand Down
6 changes: 3 additions & 3 deletions videokit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repositories {
mavenCentral()
}
group 'com.infullmobile.android'
version '1.0'
version '1.0.1'

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
Expand Down Expand Up @@ -73,8 +73,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
public interface CommandBuilder {
CommandBuilder overwriteOutput();
CommandBuilder addInputPath(String inputFilePath);
CommandBuilder addOutputPath(String outputPath);
CommandBuilder outputPath(String outputPath);
CommandBuilder trimForDuration(int startPosition, int duration);
CommandBuilder withoutAudio();
CommandBuilder copyVideoCodec();
CommandBuilder addCrop(int x, int y, int width, int height);
CommandBuilder addCustomCommand(String customCommand);
CommandBuilder limitVideoBitrate(String bitrate);
CommandBuilder addExperimentalFlag();
CommandBuilder experimentalFlag();
CommandBuilder limitFrameRate(int framerate);
CommandBuilder setTuneToFast();
Command build();
Expand Down
Loading

0 comments on commit a417aae

Please sign in to comment.