Skip to content

Commit

Permalink
Load FFprobe during init
Browse files Browse the repository at this point in the history
  • Loading branch information
brarcher committed Apr 1, 2018
1 parent ff8c38a commit a70f571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/protect/videotranscoder/FFmpegUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import nl.bravobit.ffmpeg.ExecuteBinaryResponseHandler;
import nl.bravobit.ffmpeg.FFmpeg;
import nl.bravobit.ffmpeg.FFprobe;
import nl.bravobit.ffmpeg.exceptions.FFmpegCommandAlreadyRunningException;
import protect.videotranscoder.media.AudioCodec;
import protect.videotranscoder.media.MediaInfo;
Expand All @@ -29,6 +30,7 @@ public class FFmpegUtil
{
private static final String TAG = "VideoTranscoder";
private static FFmpeg ffmpeg;
private static FFprobe ffprobe;

/**
* Load FFmpeg binary
Expand All @@ -39,10 +41,12 @@ public static boolean init(final Context context)
{
Log.d(TAG, "Creating FFmpeg instance");
final FFmpeg tmpFfmpeg = FFmpeg.getInstance(context.getApplicationContext());
final FFprobe tmpFfprobe = FFprobe.getInstance(context.getApplicationContext());

if(tmpFfmpeg.isSupported())
if(tmpFfmpeg.isSupported() && tmpFfprobe.isSupported())
{
ffmpeg = tmpFfmpeg;
ffprobe = tmpFfprobe;
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;

import nl.bravobit.ffmpeg.ExecuteBinaryResponseHandler;
import nl.bravobit.ffmpeg.FFprobe;
import protect.videotranscoder.FFmpegUtil;
import protect.videotranscoder.R;
import protect.videotranscoder.activity.MainActivity;
Expand Down

0 comments on commit a70f571

Please sign in to comment.