mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
增加打印日志
This commit is contained in:
@@ -247,11 +247,13 @@ 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());
|
||||
Encoder encoder = new Encoder();
|
||||
try {
|
||||
//System.out.println(fileFullPath);
|
||||
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
|
||||
Long ls = m.getDuration() / 1000;//秒
|
||||
log.info("文件时长 "+ls);
|
||||
//System.out.print("视频时长:" + ls + "秒");
|
||||
file.setDuration(ls.intValue());
|
||||
if("mp3".equals(file.getFileType())){// mp3
|
||||
@@ -260,7 +262,7 @@ public class CourseFileApi extends ApiBaseController {
|
||||
file.setDecoder(m.getVideo().getDecoder());
|
||||
file.setVideoHeight(m.getVideo().getSize().getHeight());
|
||||
file.setVideoWidth(m.getVideo().getSize().getWidth());
|
||||
|
||||
log.info("文件的编码 "+file.getDecoder());
|
||||
if(StringUtils.isBlank(file.getDecoder()) || !file.getDecoder().equals("h264")) {
|
||||
log.error("编码格式不是h264,不能上传");
|
||||
return error("编码格式不是h264,请先转码再上传","");
|
||||
|
||||
Reference in New Issue
Block a user