diff --git a/app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java b/app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java index 54fb259..bb73dbe 100644 --- a/app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java +++ b/app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java @@ -156,6 +156,9 @@ public class FFmpegCmd { public static void onProgressCallback(int position, int duration, @FFmpegState int state) { Log.e("FFmpegCmd", "onProgress position=" + position + "--duration=" + duration + "--state=" + state); + if (position > duration && duration > 0) { + return; + } if (mProgressListener != null) { if (position > 0 && duration > 0) { int progress = position * 100 / duration; diff --git a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java index 3fde110..bc1f5bb 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java +++ b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java @@ -222,8 +222,8 @@ public class VideoHandleActivity extends BaseActivity { break; case R.id.btn_generate_gif://convert video into gif String Video2Gif = PATH + File.separator + "Video2Gif.gif"; - int gifStart = 30; - int gifDuration = 10; + int gifStart = 10; + int gifDuration = 6; int width = 320; int frameRate = 10; String palettePath = PATH + "/palette.png"; diff --git a/gif/preview.gif b/gif/preview.gif index 3b8ab23..d045988 100644 Binary files a/gif/preview.gif and b/gif/preview.gif differ