From ce2c2561e67819bc7cad880e5e9691eb6f1d97a0 Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Fri, 23 Oct 2020 23:22:28 +0800 Subject: [PATCH] use avoid_negative_ts when cutting video use avoid_negative_ts when cutting video --- app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java index 627d72a..384e526 100644 --- a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java +++ b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java @@ -200,7 +200,7 @@ public class FFmpegUtil { * @return cut video success or not */ public static String[] cutVideo(String inputPath, int startTime, int duration, String outputPath) { - String cutVideoCmd = "ffmpeg -ss %d -accurate_seek -t %d -i %s -acodec copy -vcodec copy -no_negative_ts 1 %s"; + String cutVideoCmd = "ffmpeg -ss %d -accurate_seek -t %d -i %s -acodec copy -vcodec copy -avoid_negative_ts 1 %s"; cutVideoCmd = String.format(Locale.getDefault(), cutVideoCmd, startTime, duration, inputPath, outputPath); return cutVideoCmd.split(" "); }