| | |
| | | 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秒左右,如果是大佬随意改 |
| | |
| | | .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); |