/// <summary> /// Download latest FFmpeg version for current operating system to "." directory. Works best with FFmpeg.ExecutablesPath as path /// <param name="version">Determine which version of FFmpeg should be downloaded</param> /// <param name="path">FFmpeg executables destination directory</param> /// <param name="progress">Progress of download</param> /// </summary> public static async Task GetLatestVersion(FFmpegVersion version, string path, IProgress <ProgressInfo> progress = null) { IFFmpegDownloader downloader; switch (version) { case FFmpegVersion.Official: downloader = new OfficialFFmpegDownloader(); break; case FFmpegVersion.Full: downloader = new FullFFmpegDownloader(); break; case FFmpegVersion.Shared: downloader = new SharedFFmpegDownloader(); break; case FFmpegVersion.Android: downloader = new AndroidFFmpegDownloader(); break; default: throw new NotImplementedException(); } await downloader.GetLatestVersion(path, progress); }
public async Task <IActionResult> Versions() { FFmpegTask ffmpeg = new FFmpegTask(); ffmpeg.Start(); FFmpegVersion version = await ffmpeg.GetOutputAsync() as FFmpegVersion; return(Ok(version)); }
public static void Save() { XmlDocument document = new XmlDocument(); XmlElement settingsElement = document.AppendNewChildElement("YaffmiSettings"); settingsElement.AppendNewChildElement("ShowAdvancedTab", ShowAdvancedTab.ToString().ToLower()); settingsElement.AppendNewChildElement("ShowFullInputFilePath", ShowFullInputFilePath.ToString().ToLower()); settingsElement.AppendNewChildElement("NeverAbortOnError", NeverAbortOnError.ToString().ToLower()); settingsElement.AppendNewChildElement("DefaultOutputFolder", DefaultOutputFolder); settingsElement.AppendNewChildElement("DefaultSaveLog", DefaultSaveLog.ToString().ToLower()); settingsElement.AppendNewChildElement("FFmpegPath32", FFmpegPath32); settingsElement.AppendNewChildElement("FFmpegPath64", FFmpegPath64); settingsElement.AppendNewChildElement("FFmpegVersion", FFmpegVersion.ToString(CultureInfo.InvariantCulture)); XmlWriterSettings settings = new XmlWriterSettings { Indent = true, CloseOutput = true, }; try { if (File.Exists(SettingsFile)) { File.Delete(SettingsFile); } using (XmlWriter writer = XmlWriter.Create(SettingsFile, settings)) document.WriteTo(writer); } catch (Exception e) { throw new SettingsException( SettingsException.OperationValue.Save, e); } }
/// <summary> /// Download latest FFmpeg version for current operating system to "." directory. /// <param name="version">Determine which version of FFmpeg should be downloaded</param> /// <param name="progress">Progress of download</param> /// </summary> public static async Task GetLatestVersion(FFmpegVersion version, IProgress <ProgressInfo> progress = null) { await GetLatestVersion(version, null, progress); }
/// <summary> /// Download latest FFmpeg version for current operating system to FFmpeg.ExecutablePath. If it is not set download to ".". /// <param id="version">Determine which version of FFmpeg should be downloaded</param> /// </summary> public static async Task GetLatestVersion(FFmpegVersion version) { await GetLatestVersion(version, null); }