mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
szx-1283 撤回修改
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 + "秒");
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user