ly 3 tahun lalu
induk
melakukan
4b55051850

+ 0 - 45
master/src/main/java/com/ruoyi/common/utils/ffmpeg/MediaConvertUtils.java

@@ -1,45 +0,0 @@
-package com.ruoyi.common.utils.ffmpeg;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MediaConvertUtils {
-
-    public static String exchangeToMp4(String ffmpegPath, String upFilePath, String codcFilePath) throws Exception {
-        // 创建List集合来保存转换视频文件为flv格式的命令
-        List<String> convert = new ArrayList<String>();
-        convert.add(ffmpegPath); // 添加转换工具路径
-        convert.add("-y"); // 该参数指定将覆盖已存在的文件
-        convert.add("-i");
-        convert.add(upFilePath);
-        convert.add("-c:v");
-        convert.add("libx264");
-        convert.add("-c:a");
-        convert.add("aac");
-        convert.add("-strict");
-        convert.add("-2");
-        convert.add("-pix_fmt");
-        convert.add("yuv420p");
-        convert.add("-movflags");
-        convert.add("faststart");
-        //convert.add("-vf");   // 添加水印
-        //convert.add("movie=watermark.gif[wm];[in][wm]overlay=20:20[out]");
-        convert.add(codcFilePath);
-
-
-        try {
-            Process videoProcess = new ProcessBuilder(convert).redirectErrorStream(true).start();
-            new PrintStream(videoProcess.getInputStream()).start();
-            //videoProcess.waitFor();  // 加上这句,系统会等待转换完成。不加,就会在服务器后台自行转换。
-
-        } catch (Exception e) {
-
-            System.out.println(e);
-            e.printStackTrace();
-        }
-        return codcFilePath;
-    }
-
-
-
-}

+ 0 - 30
master/src/main/java/com/ruoyi/common/utils/ffmpeg/PrintStream.java

@@ -1,30 +0,0 @@
-package com.ruoyi.common.utils.ffmpeg;
-
-
-public class PrintStream extends Thread
-{
-    //线程
-    java.io.InputStream __is = null;
-    public PrintStream(java.io.InputStream is)
-    {
-        __is = is;
-    }
-
-    public void run()
-    {
-        try
-        {
-            while(this != null)
-            {
-                int _ch = __is.read();
-                if(_ch != -1)
-                    System.out.print((char)_ch);
-                else break;
-            }
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-    }
-}