Пример #1
0
        private void AvisynthInfo(string path)
        {
            AviSynthClip clip;

            // 如果出错说明不是正确的avs脚本
            try
            {
                using (clip = new AviSynthScriptEnvironment().OpenScriptFile(path)) { }
            }
            catch
            {
                return;
            }
            // 是正确的avs脚本
            this._container = "avs";
            this._hasVideo  = clip.HasVideo;
            this._filePath  = path;
            if (clip.ChannelsCount != 0)
            {
                this._audioStreamsCount = 1;
            }
            else
            {
                this._audioStreamsCount = 0;
            }
            if (clip.HasVideo)
            {
                this._width              = clip.VideoWidth;
                this._height             = clip.VideoHeight;
                this._displayAspectRatio = ((double)this._width) / ((double)this._height);
                this._frameRate          = Math.Round((double)(((double)clip.raten) / ((double)clip.rated)), 3, MidpointRounding.AwayFromZero);
                this._frameCount         = clip.num_frames;
                this._ffmpegId           = 0;
                this._length             = ((double)clip.num_frames) / this._frameRate;
                this._mkvmergeId         = 0;
                this._format             = "avs";
            }
            else
            {
                this._hasVideo = false;
            }
        }
Пример #2
0
        private void AvisynthInfo(string path)
        {
            AviSynthClip clip;

            try
            {
                using (clip = new AviSynthScriptEnvironment().OpenScriptFile(path)) { }
            }
            catch
            {
                return;
            }
            this._filePath = path;
            if (clip.ChannelsCount > 0)
            {
                this._currentStream = 0;
                this._streamsCount  = 1;
                this._format        = "avs";
                this._streamId      = 0;
                this._trackId       = 0;
                this._length        = ((double)clip.SamplesCount) / ((double)clip.AudioSampleRate);
                this._hasVideo      = clip.HasVideo;
            }
        }