public static Video Create(string filePath) { if (File.Exists(filePath)) { ffprobeType metaData = RawFFmpeg.GetRawMetadata(filePath); return(new Video(filePath, metaData)); } else { Utilities.Error(28641); return(null); } }
public PreProcessOptions() { InitializeComponent(); var p = Program.Processor; CheckBox_Debug.Checked = p.DebuggingEnabled; // Would make more sense to just store these staticly... DropBox_Hardware.Items.AddRange(RawFFmpeg.GetAvailableHardwareAccelerators()); if (!string.IsNullOrWhiteSpace(p.UseVideoHardwareAccel)) { DropBox_Hardware.SelectedItem = p.UseVideoHardwareAccel; } CheckBox_Stability.Checked = p.RunStabilityCheck; CheckBox_Errors.Checked = p.HideErrorsUntilEnd; CheckBox_ToRam.Checked = !p.UseHDD; TextBox_Cache.Text = p.TempDirectory; CheckBox_AutoSave.Checked = p.AutoSave; DropBox_Priority.SelectedItem = p.Priority; TextBox_Output.Text = p.OutputDirectory; NumericUpDown_CPU_Limit.Value = p.CPULimit; }
private Video(string filePath, ffprobeType metaData) { FilePath = filePath; if (File.Exists(filePath)) { RawMetadata = metaData; Duration = TimeSpan.FromSeconds( (double)RawVideoMetadata.duration_ts * (double)Utilities.DivideString(RawVideoMetadata.time_base) ); if (Duration == TimeSpan.Zero) { Duration = RawFFmpeg.GetDuration(FilePath); } Geometry = new Geometry(RawVideoMetadata.width, RawVideoMetadata.height); } else { throw new FileNotFoundException(); } }
public Bitmap GetThumbnail(TimeSpan timestamp) { return(RawFFmpeg.GetThumbnail(FilePath, new System.Windows.Size(Geometry.Width, Geometry.Height), timestamp)); }