2021SC@SDUSC
目录
注入 视频处理类FFmpegUtils 以及 图片处理类 ImageMagickUtils
配置
yml 配置上传文件的临时路径
spring:
servlet:
multipart:
# 是否支持 multipart 上传文件
enabled: true
# 最大支持文件大小
max-file-size: 10MB
# 最大支持请求大小
max-request-size: 10MB
# 上传文件的临时目录
location: E:/tomcat-temp
注入 视频处理类FFmpegUtils 以及 图片处理类 ImageMagickUtils
import com.whty.zdxt.multimedia.util.FFmpegUtils;
import com.whty.zdxt.multimedia.util.ImageMagickUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@Component
public class MultimediaUtilsConfig {
/**
* 视频处理工具,因为所有压缩任务需要排队进行,所以FFmpegUtils需要是单例的,FFmpegUtils实例交由spring管理就为单例的
*/
@Bean
public FFmpegUtils fFmpegUtilsImpl() {
return new FFmpegUtils();
}
/**
* 图片处理工具<