视频拼接ffmpeg命令行参数错误: Unable to find a suitable output format for 'file.txt'

pull/222/head
Qiming 2 years ago
parent 1723280cc7
commit 454c18275e
  1. 9
      app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.kt
  2. 2
      app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java

@ -377,15 +377,10 @@ class VideoHandleActivity : BaseActivity() {
Log.e(TAG, "width=$width--height=$height") Log.e(TAG, "width=$width--height=$height")
} }
val transformCmd2 = FFmpegUtil.transformVideoWithEncode(appendPath, width, height, outputPath2) val transformCmd2 = FFmpegUtil.transformVideoWithEncode(appendPath, width, height, outputPath2)
val fileList = ArrayList<String>() val fileList = listOf(outputPath1, outputPath2)
fileList.add(outputPath1)
fileList.add(outputPath2)
FileUtil.createListFile(listPath, fileList) FileUtil.createListFile(listPath, fileList)
val jointVideoCmd = FFmpegUtil.jointVideo(listPath, targetPath) val jointVideoCmd = FFmpegUtil.jointVideo(listPath, targetPath)
val commandList = ArrayList<Array<String>>() val commandList = listOf(transformCmd1, transformCmd2, jointVideoCmd)
commandList.add(transformCmd1)
commandList.add(transformCmd2)
commandList.add(jointVideoCmd)
ffmpegHandler!!.executeFFmpegCmds(commandList) ffmpegHandler!!.executeFFmpegCmds(commandList)
} }

@ -354,7 +354,7 @@ public class FFmpegUtil {
*/ */
public static String[] jointVideo(String fileListPath, String outputPath) { public static String[] jointVideo(String fileListPath, String outputPath) {
// ffmpeg -f concat -safe 0 -i %s -c copy %s // ffmpeg -f concat -safe 0 -i %s -c copy %s
String jointVideoCmd = "ffmpeg -f concat -safe 0 -i file.txt -c copy %s"; String jointVideoCmd = "ffmpeg -f concat -safe 0 -i -c copy -y";
return insert(jointVideoCmd.split(" "), 6, fileListPath, outputPath); return insert(jointVideoCmd.split(" "), 6, fileListPath, outputPath);
} }

Loading…
Cancel
Save