diff --git a/Code/AudioVideo/FFmpegCommands.cs b/Code/AudioVideo/FFmpegCommands.cs index f7db57d..ca783da 100644 --- a/Code/AudioVideo/FFmpegCommands.cs +++ b/Code/AudioVideo/FFmpegCommands.cs @@ -89,20 +89,6 @@ namespace Flowframes DeleteSource(inputFile); } - public static async Task FramesToMp4Vfr(string framesFile, string outPath, Utils.Codec codec, int crf, float fps, AvProcess.LogMode logMode = AvProcess.LogMode.OnlyLastLine) - { - if(logMode != AvProcess.LogMode.Hidden) - Logger.Log($"Encoding MP4 video with CRF {crf}..."); - string enc = Utils.GetEnc(codec); - string preset = $"-preset {Config.Get("ffEncPreset")}"; - string vfrFilename = Path.GetFileName(framesFile); - string vsync = (Interpolate.current.interpFactor == 2) ? "-vsync 1" : "-vsync 2"; - string rate = fps.ToString().Replace(",", "."); - string extraArgs = Config.Get("ffEncArgs"); - string args = $"{vsync} -f concat -i {vfrFilename} -r {rate} -c:v {enc} -crf {crf} {preset} {extraArgs} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; - await AvProcess.RunFfmpeg(args, framesFile.GetParentDir(), logMode); - } - public static async Task FramesToVideoVfr(string framesFile, string outPath, Interpolate.OutMode outMode, float fps, AvProcess.LogMode logMode = AvProcess.LogMode.OnlyLastLine) { if (logMode != AvProcess.LogMode.Hidden) @@ -213,18 +199,6 @@ namespace Flowframes File.Delete(outFile); } - static string GetAudioExt(string videoFile) - { - switch (GetAudioCodec(videoFile)) - { - case "vorbis": return "ogg"; - case "opus": return "ogg"; - case "mp2": return "mp2"; - case "aac": return "m4a"; - default: return "wav"; - } - } - public static async Task MergeAudio(string inputFile, string audioPath, int looptimes = -1) // https://superuser.com/a/277667 { Logger.Log($"[FFCmds] Merging audio from {audioPath} into {inputFile}", true); @@ -342,7 +316,7 @@ namespace Flowframes return -1; } - static string GetAudioCodec(string path) + public static string GetAudioCodec(string path) { string args = $" -v panic -show_streams -select_streams a -show_entries stream=codec_name {path.Wrap()}"; string info = AvProcess.GetFfprobeOutput(args); diff --git a/Code/AudioVideo/FFmpegUtils.cs b/Code/AudioVideo/FFmpegUtils.cs index 838ab5e..69bdec9 100644 --- a/Code/AudioVideo/FFmpegUtils.cs +++ b/Code/AudioVideo/FFmpegUtils.cs @@ -109,5 +109,17 @@ namespace Flowframes.AudioVideo return ext; } + + static string GetAudioExt(string videoFile) + { + switch (FFmpegCommands.GetAudioCodec(videoFile)) + { + case "vorbis": return "ogg"; + case "opus": return "ogg"; + case "mp2": return "mp2"; + case "aac": return "m4a"; + default: return "wav"; + } + } } } diff --git a/Pkgs/av/ffmpeg.exe b/Pkgs/av/ffmpeg.exe index f06cbf4..dfd0d45 100644 Binary files a/Pkgs/av/ffmpeg.exe and b/Pkgs/av/ffmpeg.exe differ diff --git a/Pkgs/av/ffprobe.exe b/Pkgs/av/ffprobe.exe index 0ac2e75..fddea14 100644 Binary files a/Pkgs/av/ffprobe.exe and b/Pkgs/av/ffprobe.exe differ diff --git a/pkgs/av/avcodec-58.dll b/pkgs/av/avcodec-58.dll new file mode 100644 index 0000000..ebdc290 Binary files /dev/null and b/pkgs/av/avcodec-58.dll differ diff --git a/pkgs/av/avdevice-58.dll b/pkgs/av/avdevice-58.dll new file mode 100644 index 0000000..76f4bb9 Binary files /dev/null and b/pkgs/av/avdevice-58.dll differ diff --git a/pkgs/av/avfilter-7.dll b/pkgs/av/avfilter-7.dll new file mode 100644 index 0000000..bb16bdf Binary files /dev/null and b/pkgs/av/avfilter-7.dll differ diff --git a/pkgs/av/avformat-58.dll b/pkgs/av/avformat-58.dll new file mode 100644 index 0000000..a20e91a Binary files /dev/null and b/pkgs/av/avformat-58.dll differ diff --git a/pkgs/av/avutil-56.dll b/pkgs/av/avutil-56.dll new file mode 100644 index 0000000..3736fe9 Binary files /dev/null and b/pkgs/av/avutil-56.dll differ diff --git a/pkgs/av/postproc-55.dll b/pkgs/av/postproc-55.dll new file mode 100644 index 0000000..6fcf4a3 Binary files /dev/null and b/pkgs/av/postproc-55.dll differ diff --git a/pkgs/av/swresample-3.dll b/pkgs/av/swresample-3.dll new file mode 100644 index 0000000..b95d21f Binary files /dev/null and b/pkgs/av/swresample-3.dll differ diff --git a/pkgs/av/swscale-5.dll b/pkgs/av/swscale-5.dll new file mode 100644 index 0000000..5c76b71 Binary files /dev/null and b/pkgs/av/swscale-5.dll differ