kongzy
2024-09-14 f0f00e9ba8a755e4317e029d73b69a92ad9f9df1
exam-common/src/main/java/com/gkhy/exam/common/utils/M3u8Utils.java
@@ -100,8 +100,9 @@
        String path = new File(System.getProperty("user.dir")).getAbsolutePath();
        path=path+filePath.getBasePath()+mainName;
        if (!FileUtil.exist(path)) {
            FileUtil.mkdir(path);
            FileUtil.del(path);
        }
        FileUtil.mkdir(path);
        String m3u8FileName = path+"/" + mainName + ".m3u8";
        //下面这一串参数别乱动,经过调优的,1G视频大概需要10秒左右,如果是大佬随意改
@@ -119,7 +120,9 @@
                .setStrict(FFmpegBuilder.Strict.STRICT)
                .setFormat("hls")
                .setPreset("ultrafast")
                .addExtraArgs("-vsync", "2", "-c:v", "copy", "-c:a", "copy", "-tune", "fastdecode", "-hls_wrap", "0", "-hls_time", "10", "-hls_list_size", "0", "-threads", "12")
               // .addExtraArgs("-vsync", "2", "-c:v", "copy", "-c:a", "copy", "-tune", "fastdecode", "-hls_wrap", "0", "-hls_time", "10", "-hls_list_size", "0", "-threads", "12")  #新版本hls_wrap参数不支持
               // .addExtraArgs("-vsync", "2", "-c:v", "copy", "-c:a", "copy", "-tune", "fastdecode", "-hls_flags", "delete_segments", "-hls_time", "10", "-hls_list_size", "0", "-threads", "12")
                .addExtraArgs("-vsync", "2", "-c:v", "copy", "-c:a", "copy", "-tune", "fastdecode", "-hls_flags", "delete_segments", "-hls_time", "10", "-hls_list_size", "0", "-threads", "6")
                .done();
        FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);