public static VideoInfo TryReadVideoInfoViaAviHeader(string fileName) { var info = new VideoInfo { Success = false }; try { using (var rp = new RiffParser()) { if (rp.TryOpenFile(fileName) && rp.FileType == RiffParser.CkidAvi) { var dh = new RiffDecodeHeader(rp); dh.ProcessMainAvi(); info.FileType = RiffParser.FromFourCc(rp.FileType); info.Width = dh.Width; info.Height = dh.Height; info.FramesPerSecond = dh.FrameRate; info.TotalFrames = dh.TotalFrames; info.TotalMilliseconds = dh.TotalMilliseconds; info.TotalSeconds = info.TotalMilliseconds / TimeCode.BaseUnit; info.VideoCodec = dh.VideoHandler; info.Success = true; } } } catch { // ignored } return(info); }
public Wave(string fileName) { RiffParser parser = new RiffParser(); RiffDecodeHeader decoder = new RiffDecodeHeader(parser); parser.OpenFile(fileName); if (RiffParser.ckidAVI == parser.FileType) { decoder.ProcessMainAVI(); decoder.ProcessMainWAVE(); parser.CloseFile(); } }
public Wave(string fileName) { RiffParser parser = new RiffParser(); RiffDecodeHeader decoder = new RiffDecodeHeader(parser); parser.OpenFile(fileName); if (RiffParser.ckidAVI == parser.FileType) { decoder.ProcessMainAVI(); decoder.ProcessMainWAVE(); parser.CloseFile(); } }
private static VideoInfo TryReadVideoInfoViaAviHeader(string fileName) { var info = new VideoInfo { Success = false }; try { using (var rp = new RiffParser()) { var dh = new RiffDecodeHeader(rp); rp.OpenFile(fileName); info.FileType = RiffParser.FromFourCC(rp.FileType); if (RiffParser.ckidAVI == rp.FileType) { dh.ProcessMainAVI(); info.Width = dh.Width; info.Height = dh.Height; info.FramesPerSecond = dh.FrameRate; info.TotalFrames = dh.TotalFrames; info.TotalMilliseconds = dh.TotalMilliseconds; info.TotalSeconds = info.TotalMilliseconds / TimeCode.BaseUnit; info.VideoCodec = dh.VideoHandler; info.Success = true; } } } catch { } return info; }