@@ -164,10 +164,14 @@ public class OssUtils {
* 获取指定的视频文件后进行封面截图为jpg
*/
private File generateCover(File inputFile) {
+ log.info("视频截图开始==="+inputFile.getName());
try {
+
+ // 创建ProcessBuilder对象
+ log.info("输入路径==="+inputFile.getAbsolutePath());
// 截图保存位置
String outName = "out"+CgpTool.generateUUID()+".jpg";
- String command = "ffmpeg -i " + inputFile.getAbsolutePath() + " -ss 00:00:02 -vframes 1"+ outName;
+ String command = "ffmpeg -i " + inputFile.getAbsolutePath() + " -ss 00:00:02 -vframes 1 "+ outName;
log.info("封面截图方式==="+command);
ProcessBuilder pb = new ProcessBuilder("ffmpeg","-i",inputFile.getAbsolutePath(),"-ss","00:00:02","-vframes","1",outName);
pb.redirectErrorStream(true);