/// <summary> /// Format a video size (scale) argument for ffmpeg. /// </summary> public static string formatVideoSizeArg(string inFile, ImageSize size, ImageCrop crop, int width_multiple, int height_multiple) { string videoSizeArg = ""; ImageSize outSize = size; outSize.Width = UtilsCommon.getNearestMultiple(outSize.Width, width_multiple); outSize.Height = UtilsCommon.getNearestMultiple(outSize.Height, height_multiple); videoSizeArg = $"scale={outSize.Width}:{outSize.Height}"; // {1} return(videoSizeArg); }
private void computeNewDimesions() { int widthIncrement = 2; int heightIncrement = 2; newRes.Width = (int)(((float)this.numericUpDownPercent.Value / 100.0) * (int)numericUpDownOrigWidth.Value); newRes.Height = (int)(((float)this.numericUpDownPercent.Value / 100.0) * (int)numericUpDownOrigHeight.Value); if (chooserType == VideoDimesionsChoooserType.Video) { widthIncrement = 16; } newRes.Width = UtilsCommon.getNearestMultiple(newRes.Width, widthIncrement); newRes.Height = UtilsCommon.getNearestMultiple(newRes.Height, heightIncrement); if (newRes.Width < 16) { newRes.Width = 16; } else if (newRes.Width > 2048) { newRes.Width = 2048; } if (newRes.Height < 16) { newRes.Height = 16; } else if (newRes.Height > 2048) { newRes.Height = 2048; } this.textBoxNewWidth.Text = newRes.Width.ToString(); this.textBoxNewHeight.Text = newRes.Height.ToString(); }