From b80c7bfb11eb4cce4243f78b9d18a7a5ba3cf64e Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Tue, 24 Mar 2020 23:11:30 +0800 Subject: [PATCH] update the cmd of reverse video update the cmd of reverse video --- app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java | 6 +++--- app/src/main/res/layout/activity_video_handle.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 0592a6c..844bc41 100644 --- a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java +++ b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java @@ -321,9 +321,9 @@ public class FFmpegUtil { * @return 视频反序的命令行 */ public static String[] reverseVideo(String inputFile, String targetFile) { - //FIXME 音频也反序 -// String reverseVideo = "ffmpeg -i %s -filter_complex [0:v]reverse[v];[0:a]areverse[a] -map [v] -map [a] %s"; - String reverseVideo = "ffmpeg -i %s -filter_complex [0:v]reverse[v] -map [v] %s";//单纯视频反序 + //-vf reverse视频反序, -an去掉音频 + //视频反序比较耗时, 建议用来处理1分钟以内的短视频 + String reverseVideo = "ffmpeg -i %s -vf reverse -an %s"; reverseVideo = String.format(reverseVideo, inputFile, targetFile); return reverseVideo.split(" "); } diff --git a/app/src/main/res/layout/activity_video_handle.xml b/app/src/main/res/layout/activity_video_handle.xml index fb36e97..54a6702 100644 --- a/app/src/main/res/layout/activity_video_handle.xml +++ b/app/src/main/res/layout/activity_video_handle.xml @@ -93,7 +93,7 @@ android:layout_height="wrap_content" android:layout_marginTop="4dp" android:text="@string/video_reverse" - android:visibility="gone"/> + android:visibility="visible"/>