FFMpeg/FFprobe compiled for Android
FFMpeg/FFprobe compiled for Android.
Execute FFmpeg & FFprobe commands with ease in your Android project.
This project is a continued fork of FFmpeg Android Java by WritingMinds.
This fork fixes the CANNOT LINK EXECUTABLE ffmpeg: has text relocations
issue on x86 devices along with some other bugfixes, new features and the newest FFmpeg builds.
Bravobit FFmpeg-Android runs on the following architectures:
FFmpeg in this project was built with the following libraries:
r2851 ba24899
1.6.21
2.8.1
3.100
1.3.5
v1.6.1-1456-g7d1bf5d
1.2.1
2.11.94
0.14.0
0.19.7
2.1.0
0.1.6
n4.0-39-gda39990
Include the dependency
dependencies {
implementation 'nl.bravobit:android-ffmpeg:1.1.7'
}
To check whether FFmpeg is available on your device you can use the following method.
if (FFmpeg.getInstance(this).isSupported()) {
// ffmpeg is supported
} else {
// ffmpeg is not supported
}
This is all you have to do to load the FFmpeg library.
In this sample code we will run the ffmpeg -version command.
FFmpeg ffmpeg = FFmpeg.getInstance(context);
// to execute "ffmpeg -version" command you just need to pass "-version"
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onProgress(String message) {}
@Override
public void onFailure(String message) {}
@Override
public void onSuccess(String message) {}
@Override
public void onFinish() {}
});
If you want to stop the running FFmpeg process, simply call .sendQuitSignal()
on the FFtask
that is running:
FFmpeg ffmpeg = FFmpeg.getInstance(context);
FFtask ffTask = ffmpeg.execute( ... )
ffTask.sendQuitSignal();
NOTE: This will result in onFailure
being called instead of onSuccess
.
To check whether FFprobe is available on your device you can use the following method.
if (FFprobe.getInstance(this).isSupported()) {
// ffprobe is supported
} else {
// ffprobe is not supported
}
This is all you have to do to load the FFprobe library.
In this sample code we will run the ffprobe -version command.
FFprobe ffprobe = FFprobe.getInstance(context);
// to execute "ffprobe -version" command you just need to pass "-version"
ffprobe.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onProgress(String message) {}
@Override
public void onFailure(String message) {}
@Override
public void onSuccess(String message) {}
@Override
public void onFinish() {}
});