mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
szx-1283 修改ffmpeg路径
This commit is contained in:
@@ -50,6 +50,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import ws.schild.jave.Encoder;
|
||||
import ws.schild.jave.MultimediaObject;
|
||||
import ws.schild.jave.info.MultimediaInfo;
|
||||
import ws.schild.jave.process.ffmpeg.DefaultFFMPEGLocator;
|
||||
import ws.schild.jave.process.ffmpeg.FFMPEGProcess;
|
||||
|
||||
/**
|
||||
@@ -261,7 +262,12 @@ public class CourseFileApi extends ApiBaseController {
|
||||
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
|
||||
try {
|
||||
//System.out.println(fileFullPath);
|
||||
MultimediaInfo m = new MultimediaObject(new File(fileFullPath)).getInfo();
|
||||
MultimediaInfo m = new MultimediaObject(new File(fileFullPath), new DefaultFFMPEGLocator() {
|
||||
@Override
|
||||
public String getExecutablePath() {
|
||||
return "/usr/local/opt/ffmpeg";
|
||||
}
|
||||
}).getInfo();
|
||||
Long ls = m.getDuration() / 1000;//秒
|
||||
log.info("文件时长 "+ls);
|
||||
//System.out.print("视频时长:" + ls + "秒");
|
||||
|
||||
Reference in New Issue
Block a user