Exemple #1
0
        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);
        }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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;
        }