|
|
|
@ -2,7 +2,7 @@ package com.dsideal.QingLong.YunXiao.Util;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.RuntimeUtil;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
|
|
|
|
|
public class YunXiaoVideoUtil {
|
|
|
|
|
//MP4的片头长10秒
|
|
|
|
@ -53,18 +53,18 @@ public class YunXiaoVideoUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取视频封面
|
|
|
|
|
*
|
|
|
|
|
* @param url
|
|
|
|
|
* @param JpegPath
|
|
|
|
|
*/
|
|
|
|
|
public static void getCover(String url, String JpegPath) {
|
|
|
|
|
public static void getCover(String url, String JpegPath) throws InterruptedException {
|
|
|
|
|
String cmd = getCmd(url, JpegPath);
|
|
|
|
|
//使用java调用ffmpeg命令行工具生成图片
|
|
|
|
|
RuntimeUtil.exec(cmd);
|
|
|
|
|
|
|
|
|
|
System.out.println(JpegPath);
|
|
|
|
|
Process process = RuntimeUtil.exec(cmd);
|
|
|
|
|
process.waitFor();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
public static void main(String[] args) throws InterruptedException {
|
|
|
|
|
String[] a = {
|
|
|
|
|
"https://ccschool.edusoa.com/cloud_file/project/ccyx-0012/material/5b/c5/5bc51a9075751b69a9c1c5d722c39485.mp4",
|
|
|
|
|
"https://ccmsyk-video.edusoa.com/down/M3u8/BE/BECBF507-1EAF-4301-A417-AE25593A62F1.m3u8",
|
|
|
|
|