szx-1283 撤回修改

This commit is contained in:
Caojr
2025-11-03 16:07:12 +08:00
parent 308a16f4b4
commit 00527271b6
4 changed files with 6 additions and 28 deletions

View File

@@ -82,19 +82,12 @@
<version>5.8.16</version>
</dependency>
<!--<dependency>
<dependency>
<groupId>it.sauronsoftware</groupId>
<artifactId>jave</artifactId>
<version>1.0.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/libs/jave-1.0.2.jar</systemPath>
</dependency>-->
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.3.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/libs/jave-core-3.3.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.auth0</groupId>

View File

@@ -1,15 +0,0 @@
package com.xboe.config;
import ws.schild.jave.process.ffmpeg.DefaultFFMPEGLocator;
/**
* @author guo jia
*/
public class CustomFFMPEGLocator extends DefaultFFMPEGLocator {
@Override
public String getExecutablePath() {
return "/usr/local/opt/ffmpeg/ffmpeg";
}
}

View File

@@ -15,7 +15,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.xboe.config.CustomFFMPEGLocator;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.orm.ObjectOptimisticLockingFailureException;
import org.springframework.web.bind.annotation.GetMapping;
@@ -48,8 +49,6 @@ import com.xboe.standard.BaseConstant;
import com.xboe.standard.enums.BoedxCourseFileType;
import lombok.extern.slf4j.Slf4j;
import ws.schild.jave.MultimediaObject;
import ws.schild.jave.info.MultimediaInfo;
/**
* 课件资源表,课程的相关文件内容
@@ -257,10 +256,11 @@ public class CourseFileApi extends ApiBaseController {
}
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
Encoder encoder = new Encoder();
try {
//System.out.println(fileFullPath);
MultimediaInfo m = new MultimediaObject(new File(fileFullPath), new CustomFFMPEGLocator()).getInfo();
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
Long ls = m.getDuration() / 1000;//秒
log.info("文件时长 "+ls);
//System.out.print("视频时长:" + ls + "秒");