Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.diegoperini:ffmpeg-android-java:v0.4.7'
}
<dependency>
<groupId>com.github.diegoperini</groupId>
<artifactId>ffmpeg-android-java</artifactId>
<version>v0.4.7</version>
</dependency>
libraryDependencies += "com.github.diegoperini" % "ffmpeg-android-java" % "v0.4.7"
:dependencies [[com.github.diegoperini/ffmpeg-android-java "v0.4.7"]]
This project is discontinued. There is a much better alternative by bravobit which incorporates good parts of this fork and also attempts to solve some existing issues. I'll be keeping a close eye to its issue tracker and contribute there instead.
Edit your project's build.gradle (not app) like this. (important line is jitpack)
allprojects {
repositories {
jcenter()
mavenCentral()
...
maven {
url 'https://jitpack.io'
}
}
}
Add below line to your app's build.gradle dependencies.
compile 'com.github.diegoperini:ffmpeg-android-java:v0.4.9'
whenFFmpegIsReady()
to properly wait for ffmpeg state.killRunningProcesses()
to properly kill the execution.FFmpeg.getInstance()
overload to work with a ContextProvider
instead of a context. It is a fix for a common memory leak caused by storing the context internally. Old factory method is still supported but marked as deprecated.isFFmpegCommandRunning()
to properly return running state status. (thanks to @pawaom)GPLv3
FFmpeg Android java is a java library that simplifies your task of using ffmpeg in Android project which I've compiled using FFmpeg-Android
These are two basic methods of this library:
loadBinary(FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) throws FFmpegNotSupportedException
execute(String cmd, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) throws FFmpegCommandAlreadyRunningException
For examples and usage instructions head over to: