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 b04bf5d..2495da4 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt +++ b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt @@ -339,7 +339,7 @@ class VideoHandleActivity : BaseActivity() { R.id.btn_add_subtitle//add subtitle into video -> { val subtitlePath = PATH + File.separator + "test.ass" - val addSubtitlePath = PATH + File.separator + "subtitle" + suffix + val addSubtitlePath = PATH + File.separator + "subtitle.mkv" commandLine = FFmpegUtil.addSubtitleIntoVideo(srcFile, subtitlePath, addSubtitlePath) } R.id.btn_rotate// set the rotate degree of video 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 0e97cfa..3b41b6e 100644 --- a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java +++ b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java @@ -702,7 +702,7 @@ public class FFmpegUtil { } public static String[] addSubtitleIntoVideo(String inputPath, String subtitlePath, String outputPath) { - String subtitleCmd = "ffmpeg -i %s -vf subtitles=%s %s"; + String subtitleCmd = "ffmpeg -i %s -i %s -map 0:v -map 0:a -map 1:s -c copy %s"; subtitleCmd = String.format(subtitleCmd, inputPath, subtitlePath, outputPath); return subtitleCmd.split(" "); }