所以我正在编写 ac# 应用程序,它允许用户将视频以像素为单位缩放到自定义尺寸。我正在努力从 mpeg psi 参数的文本框中获取用户输入:
这是代码:
var localStoragePath = Path.Combine(Path.GetTempPath(), name);
var directoryPath = Path.GetDirectoryName(localStoragePath);
Directory.CreateDirectory(directoryPath);
File.WriteAllBytes(localStoragePath, bytes);
Progress.Text = ($"File copy successful: {File.Exists(localStoragePath)}");
var readBack = File.ReadAllBytes(localStoragePath);
Progress.Text = ($"Read file Back: {readBack.Length}, {localStoragePath}");
var resizedFolderPath = @"C:\upscaledvideohere";
Directory.CreateDirectory(resizedFolderPath);
var resizedFiePath = Path.Combine(resizedFolderPath, Path.GetFileName(localStoragePath));
var psi = new ProcessStartInfo();
psi.FileName = @"C:\ffmpeg-2020-12-27-git-bff6fbead8-full_build\bin\ffmpeg.exe";
psi.Arguments = $"-i \"{localStoragePath}\" -vf scale=" + pixelsheight.Text "\"{resizedFiePath}\"";
psi.RedirectStandardOutput = false;
psi.RedirectStandardError = false;
psi.UseShellExecute = true;
Progress.Text = ($"Args: {psi.Arguments}");
为了
psi.Arguments = $"-i \"{localStoragePath}\" -vf scale=" + pixelsheight.Text "\"{resizedFiePath}\""
输入用户在像素高度文本框中输入的文本的正确方法是什么?
非常感谢。