main
黄海 7 months ago
parent fe0d7b0d4c
commit f1a50f41a3

@ -145,9 +145,10 @@ public class YunXiaoController extends Controller {
*
* @param url
*/
// http://10.10.21.20:9000/QingLong/yx/getLessonCover?url=
// http://10.10.21.20:9000/QingLong/yx/getLessonCover?url=https://ccmsyk-video.edusoa.com/down/M3u8/73/7311BCC2-D260-4D34-9B70-3722DB884CB6.m3u8
// http://10.10.21.20:9000/QingLong/yx/getLessonCover?url=https://ccschool.edusoa.com/cloud_file/project/ccyx-0012/material/5b/c5/5bc51a9075751b69a9c1c5d722c39485.mp4
@Before(GET.class)
public void getLessonCover(String url) {
public void getLessonCover(String url) throws InterruptedException {
//获取系统临时目录
String tmpDir = System.getProperty("java.io.tmpdir");
//使用guid生成一个临时文件名然后拼接到tmpDir后面生成完整的临时文件路径

@ -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",

Loading…
Cancel
Save