Updated ffmpeg to shared build with VP9/ProRes/AV1/etc support

This commit is contained in:
N00MKRAD
2020-12-25 00:39:14 +01:00
parent d79926bfd1
commit 21776eb926
12 changed files with 13 additions and 27 deletions

View File

@@ -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);

View File

@@ -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";
}
}
}
}

Binary file not shown.

Binary file not shown.

BIN
pkgs/av/avcodec-58.dll Normal file

Binary file not shown.

BIN
pkgs/av/avdevice-58.dll Normal file

Binary file not shown.

BIN
pkgs/av/avfilter-7.dll Normal file

Binary file not shown.

BIN
pkgs/av/avformat-58.dll Normal file

Binary file not shown.

BIN
pkgs/av/avutil-56.dll Normal file

Binary file not shown.

BIN
pkgs/av/postproc-55.dll Normal file

Binary file not shown.

BIN
pkgs/av/swresample-3.dll Normal file

Binary file not shown.

BIN
pkgs/av/swscale-5.dll Normal file

Binary file not shown.