public static Size GetVideoRes(string path) { Size size = new Size(0, 0); try { ShellFile shellFile = ShellFile.FromFilePath(path); int w = (int)shellFile.Properties.System.Video.FrameWidth.Value; int h = (int)shellFile.Properties.System.Video.FrameHeight.Value; return(new Size(w, h)); } catch (Exception e) { Logger.Log($"Failed to read video size ({e.Message}) - Trying alternative method...", true); try { size = FfmpegCommands.GetSize(path); Logger.Log($"Detected video size of {Path.GetFileName(path)} as {size.Width}x{size.Height}", true); } catch { Logger.Log("Failed to read video size!"); } } return(size); }
public static Size GetVideoRes(string path) { Size size = new Size(0, 0); try { size = FfmpegCommands.GetSize(path); Logger.Log($"Detected video size of {Path.GetFileName(path)} as {size.Width}x{size.Height}", true); } catch { Logger.Log("Failed to read video size!"); } return(size); }