String cut = "ffmpeg -ss " + startTime +" -i " + videoPath + " -t " + String.valueOf(seconds) + " -c:v copy -c:a copy " + outPath +outPutFileName+".mp4"; String cut = "ffmpeg -ss " + startTime +" -t " + String.valueOf(seconds) + " -i " + videoPath + " -vcodec copy -acodec copy " + outPath +outPutFileName+".mp4";
String cut="ffmpeg -i "+videoPath+" -vcodec copy -acodec copy -ss "+startTime+" -to "+seconds+" "+outPath+outPutFileName+".mp4 -y";
startTime 截取视频开始时间
videoPath 原始视频路径及文件名称
seconds 截取视频时间(1,2 为截取时间,3为截取到多少时间)
outPath 输出路径
outPutFileName 输出文件名称