|
@@ -142,9 +142,9 @@ public class OssUtils {
|
|
|
log.info("输入路径==="+inputFile.getAbsolutePath());
|
|
log.info("输入路径==="+inputFile.getAbsolutePath());
|
|
|
// 截图保存位置
|
|
// 截图保存位置
|
|
|
String outName = "out"+CgpTool.generateUUID()+".jpg";
|
|
String outName = "out"+CgpTool.generateUUID()+".jpg";
|
|
|
- String command = "ffmpeg -i " + inputFile.getAbsolutePath() + " -ss 00:00:02 -vframes 1 "+ outName;
|
|
|
|
|
|
|
+ String command = "ffmpeg -sseof -1 -i " + inputFile.getAbsolutePath() + " -vframes 1 "+ outName;
|
|
|
log.info("封面截图方式==="+command);
|
|
log.info("封面截图方式==="+command);
|
|
|
- ProcessBuilder pb = new ProcessBuilder("ffmpeg","-i",inputFile.getAbsolutePath(),"-ss","00:00:02","-vframes","1",outName);
|
|
|
|
|
|
|
+ ProcessBuilder pb = new ProcessBuilder("ffmpeg","-sseof","-1","-i",inputFile.getAbsolutePath(),"-vframes","1",outName);
|
|
|
pb.redirectErrorStream(true);
|
|
pb.redirectErrorStream(true);
|
|
|
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
|
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
|
|
Process process = pb.start();
|
|
Process process = pb.start();
|