mirror of https://github.com/n00mkrad/flowframes
Improved mpdecimate parameters and added more options for it
This commit is contained in:
parent
6ccbb875b8
commit
01850f465a
|
@ -1280,7 +1280,9 @@
|
|||
this.mpdecimateMode.FormattingEnabled = true;
|
||||
this.mpdecimateMode.Items.AddRange(new object[] {
|
||||
"Normal",
|
||||
"Aggressive"});
|
||||
"High",
|
||||
"Very High",
|
||||
"Extreme"});
|
||||
this.mpdecimateMode.Location = new System.Drawing.Point(0, 0);
|
||||
this.mpdecimateMode.Margin = new System.Windows.Forms.Padding(3, 3, 8, 3);
|
||||
this.mpdecimateMode.Name = "mpdecimateMode";
|
||||
|
|
|
@ -19,8 +19,22 @@ namespace Flowframes
|
|||
//public static string padFilter = "pad=width=ceil(iw/2)*2:height=ceil(ih/2)*2:color=black@0";
|
||||
public static string hdrFilter = @"-vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p";
|
||||
public static string pngCompr = "-compression_level 3";
|
||||
public static string mpDecDef = "\"mpdecimate\"";
|
||||
public static string mpDecAggr = "\"mpdecimate=hi=64*32:lo=64*32:frac=0.1\"";
|
||||
|
||||
public enum MpDecSensitivity { Normal = 4, High = 20, VeryHigh = 32, Extreme = 40 }
|
||||
|
||||
public static string GetMpdecimate (int sensitivity = 4, bool wrap = true)
|
||||
{
|
||||
string mpd = $"mpdecimate=hi=64*1024:lo=64*{sensitivity}:frac=1.0";
|
||||
return wrap ? mpd.Wrap() : mpd;
|
||||
}
|
||||
|
||||
public static string GetMpdecimate(bool wrap = true)
|
||||
{
|
||||
int mpdValIndex = Config.GetInt(Config.Key.mpdecimateMode);
|
||||
var mpdVal = ((MpDecSensitivity[])Enum.GetValues(typeof(MpDecSensitivity)))[mpdValIndex];
|
||||
string mpd = $"mpdecimate=hi=64*1024:lo=64*{(int)mpdVal}:frac=1.0";
|
||||
return wrap ? mpd.Wrap() : mpd;
|
||||
}
|
||||
|
||||
public static int GetModulo ()
|
||||
{
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace Flowframes.Media
|
|||
Logger.Log($"VideoToFrames() - Alpha: {alpha} - Rate: {rate} - Size: {size} - Format: {format}", true, false, "ffmpeg");
|
||||
string sizeStr = (size.Width > 1 && size.Height > 1) ? $"-s {size.Width}x{size.Height}" : "";
|
||||
IoUtils.CreateDir(framesDir);
|
||||
string mpStr = deDupe ? ((Config.GetInt(Config.Key.mpdecimateMode) == 0) ? mpDecDef : mpDecAggr) : "";
|
||||
string mpStr = deDupe ? GetMpdecimate(true) : "";
|
||||
string filters = FormatUtils.ConcatStrings(new[] { GetPadFilter(), mpStr });
|
||||
string vf = filters.Length > 2 ? $"-vf {filters}" : "";
|
||||
string rateArg = (rate.GetFloat() > 0 && !deDupe) ? $" -fps_mode cfr -r {rate}" : "-fps_mode passthrough";
|
||||
|
|
Loading…
Reference in New Issue