From b3b6d66d4a33cf502204a46cae9413246f3b98ff Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Tue, 26 Oct 2021 00:49:34 +0800 Subject: [PATCH] remove command of building flv index --- .../ffmpeg/activity/VideoHandleActivity.kt | 22 +++++-------------- .../com/frank/ffmpeg/util/FFmpegUtil.java | 4 +--- app/src/main/res/values-en/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt index 3baa13e..f82da4d 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt +++ b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt @@ -119,7 +119,6 @@ class VideoHandleActivity : BaseActivity() { getString(R.string.video_pip), getString(R.string.video_moov), getString(R.string.video_speed), - getString(R.string.video_flv), getString(R.string.video_thumbnail), getString(R.string.video_subtitle), getString(R.string.video_rotate), @@ -231,7 +230,7 @@ class VideoHandleActivity : BaseActivity() { } } } - 5 //Remove logo from video: suppress logo by a simple interpolation + 5 //Remove logo from video, or use to mosaic video -> { val removeLogoPath = PATH + File.separator + "removeLogo" + suffix val widthL = 64 @@ -332,40 +331,31 @@ class VideoHandleActivity : BaseActivity() { val speed = PATH + File.separator + "speed.mp4" commandLine = FFmpegUtil.changeSpeed(srcFile, speed, 2f, false) } - 15 //rebuild the keyframe index of flv - -> { - if (!".flv".equals(FileUtil.getFileSuffix(srcFile)!!, ignoreCase = true)) { - Log.e(TAG, "It's not flv file, suffix=" + FileUtil.getFileSuffix(srcFile)!!) - return - } - val outputPath = PATH + File.separator + "frame_index.flv" - commandLine = FFmpegUtil.buildFlvIndex(srcFile, outputPath) - } - 16 // insert thumbnail into video + 15 // insert thumbnail into video -> { val thumbnailPath = PATH + File.separator + "thumb.jpg" val thumbVideoPath = PATH + File.separator + "thumbnailVideo" + suffix commandLine = FFmpegUtil.insertPicIntoVideo(srcFile, thumbnailPath, thumbVideoPath) } - 17 //add subtitle into video + 16 //add subtitle into video -> { val subtitlePath = PATH + File.separator + "test.ass" val addSubtitlePath = PATH + File.separator + "subtitle.mkv" commandLine = FFmpegUtil.addSubtitleIntoVideo(srcFile, subtitlePath, addSubtitlePath) } - 18 // set the rotate degree of video + 17 // set the rotate degree of video -> { val rotateDegree = 90 val addSubtitlePath = PATH + File.separator + "rotate" + rotateDegree + suffix commandLine = FFmpegUtil.rotateVideo(srcFile, rotateDegree, addSubtitlePath) } - 19 // change the gop(key frame interval) of video + 18 // change the gop(key frame interval) of video -> { val gop = 30 val gopPath = PATH + File.separator + "gop" + gop + suffix commandLine = FFmpegUtil.changeGOP(srcFile, gop, gopPath) } - 20 // change video from RGB to gray + 19 // change video from RGB to gray -> { val grayPath = PATH + File.separator + "gray" + suffix commandLine = FFmpegUtil.toGrayVideo(srcFile, grayPath) 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 c70f463..0f66bff 100644 --- a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java +++ b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java @@ -414,7 +414,7 @@ public class FFmpegUtil { /** * Remove watermark from video: Suppress logo by a simple interpolation of the surrounding pixels. - * Just set a rectangle covering the logo and watch it disappear + * On the other hand, it can be used to mosaic video * * @return delogo cmd */ @@ -631,8 +631,6 @@ public class FFmpegUtil { * @return probe success or not */ public static String[] probeFormat(String inputPath) { - //show format:ffprobe -i %s -show_format -print_format json - //show stream:ffprobe -i %s -show_streams String ffprobeCmd = "ffprobe -i %s -show_streams -show_format -print_format json"; ffprobeCmd = String.format(Locale.getDefault(), ffprobeCmd, inputPath); return ffprobeCmd.split(" "); diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index d0ee7cd..fcb9165 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -63,7 +63,6 @@ Video preview MOOV move ahead Playing speed - FLV index Insert thumbnail add subtitle KeyFrame interval diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8e4789b..cc18dc3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,7 +63,6 @@ 播放预览 MOOV前移 播放倍率 - FLV索引 插入封面 添加字幕 关键帧间隔