Bootstrap

JavaCV 实现视频链接截取封面工具

引入必要依赖

 <!--JavaCV-->
<dependency>
   <groupId>org.bytedeco</groupId>
   <artifactId>javacv-platform</artifactId>
   <version>1.5.7</version>
</dependency>
<dependency>
   <groupId>cn.hutool</groupId>
   <artifactId>hutool-all</artifactId>
   <version>5.8.26</version>
</dependency>

工具类

public class UploadResult implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 文件访问路径
	 */
	private String url;
	/**
	 * md5码
	 */
	private String md5;
	/**
	 * 文件存储路径
	 */
	private String path;
	/**
	 * 域名:http://192.168.0.198:8080
	 */
	private String domain;
	/**
	 * 场景
	 */
	private String scene;
	private String scenes;
	/**
	 * 文件大小
	 */
	private BigInteger size;
	private BigInteger mtime;
	/**
	 * 返回结果消息
	 */
	private String retmsg;
	/**
	 * 返回结果状态编码
	 */
	private int retcode;
	/**
	 * 文件存储路径
	 */
	private String src;

	/**
	 * 文件名
	 */
	private String filename;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getMd5() {
		return md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getScene() {
		return scene;
	}

	public void setScene(String scene) {
		this.scene = scene;
	}

	public BigInteger getSize() {
		return size;
	}

	public void setSize(BigInteger size) {
		this.size = size;
	}

	public BigInteger getMtime() {
		return mtime;
	}

	public void setMtime(BigInteger mtime) {
		this.mtime = mtime;
	}

	public String getScenes() {
		return scenes;
	}

	public void setScenes(String scenes) {
		this.scenes = scenes;
	}

	public String getRetmsg() {
		return retmsg;
	}

	public void setRetmsg(String retmsg) {
		this.retmsg = retmsg;
	}

	public int getRetcode() {
		return retcode;
	}

	public void setRetcode(int retcode) {
		this.retcode = retcode;
	}

	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	/**
	 * 是否上传成功
	 *
	 * @return
	 */
	public boolean isSuccess() {
		return retcode == 0;
	}

	@Override
	public String toString() {
		final StringBuffer sb = new StringBuffer("UploadResult{");
		sb.append("url='").append(url).append('\'');
		sb.append(", md5='").append(md5).append('\'');
		sb.append(", path='").append(path).append('\'');
		sb.append(", domain='").append(domain).append('\'');
		sb.append(", scene='").append(scene).append('\'');
		sb.append(", scenes='").append(scenes).append('\'');
		sb.append(", size=").append(size);
		sb.append(", mtime=").append(mtime);
		sb.append(", retmsg='").append(retmsg).append('\'');
		sb.append(", retcode=").append(retcode);
		sb.append(", src='").append(src).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
;