|
|
@ -145,6 +145,7 @@ public class FFmpegUtil { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressLint("DefaultLocale") |
|
|
|
@SuppressLint("DefaultLocale") |
|
|
|
public static String[] cutVideo(String srcFile, int startTime, int duration, String targetFile) { |
|
|
|
public static String[] cutVideo(String srcFile, int startTime, int duration, String targetFile) { |
|
|
|
|
|
|
|
//指定音视频编码器:ffmpeg -i %s -ss %d -t %d -acodec libmp3lame -vcodec libx264 %s
|
|
|
|
String cutVideoCmd = "ffmpeg -i %s -ss %d -t %d -acodec copy -vcodec copy %s"; |
|
|
|
String cutVideoCmd = "ffmpeg -i %s -ss %d -t %d -acodec copy -vcodec copy %s"; |
|
|
|
cutVideoCmd = String.format(cutVideoCmd, srcFile, startTime, duration, targetFile); |
|
|
|
cutVideoCmd = String.format(cutVideoCmd, srcFile, startTime, duration, targetFile); |
|
|
|
return cutVideoCmd.split(" ");//以空格分割为字符串数组
|
|
|
|
return cutVideoCmd.split(" ");//以空格分割为字符串数组
|
|
|
|