Sirojiddin Komolov
Sirojiddin Komolov

Reputation: 791

Using ffprobe in Android

I'm using Ffmpeg via this link and works fine, but it failures when I try to use "ffprobe" commands to get video info. For example, currently I'm using these lines of codes :

ffmpeg.execute("ffprobe -v quiet -print_format json -show_format -show_streams some.mp4",
 new ExecuteBinaryResponseHandler() { ... });

Above code lines don't work and ExecuteBinaryResponseHandler's onFailure method get called. But reason message of onFailure is empty. I don't know what I'm doing wrong. Any idea?

Upvotes: 2

Views: 2081

Answers (1)

Brianvdb
Brianvdb

Reputation: 676

You can use FFprobe with this library: FFmpeg-Android

FFprobe ffprobe = FFprobe.getInstance(context);
try {
  // 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() {}

  });
} catch (FFprobeCommandAlreadyRunningException e) {
  // Handle if FFprobe is already running
}

Upvotes: 1

Related Questions