Exemple #1
0
 private void SetUpForAvsFile(string avsFile)
 {
     avsFile = Path.GetFullPath(avsFile);
     using (this._scriptInfo = new AviSynthScriptEnvironment().OpenScriptFile(avsFile)) { }
     if (!this._scriptInfo.HasVideo)
     {
         throw new AvisynthVideoStreamNotFoundException(avsFile);
     }
     this._avsFile         = avsFile;
     this._scriptFrameRate = ((double)this._scriptInfo.raten) / ((double)this._scriptInfo.rated);
     this._totalLength     = ((double)this._scriptInfo.num_frames) / this._scriptFrameRate;
     this._totalFrame      = this._scriptInfo.num_frames;
 }
Exemple #2
0
 private void SetUpForAvsFile(string avsFile)
 {
     avsFile = Path.GetFullPath(avsFile);
     // 如果不是有效的avs脚本,则AvsSynthException
     using (this.scriptInfo = new AviSynthScriptEnvironment().OpenScriptFile(avsFile))
     { }
     // 是有效的avs脚本,但不包含音频内容,AvisynthVideoStreamNotFoundException
     if ((this.scriptInfo.ChannelsCount == 0) || (((int)this.scriptInfo.SamplesCount) == 0))
     {
         throw new AvisynthAudioStreamNotFoundException(avsFile);
     }
     this._avsFile = avsFile;
     this._length  = ((double)this.scriptInfo.SamplesCount) / ((double)this.scriptInfo.AudioSampleRate);
 }
        public AviSynthFile ParseAviSynthScript(string scriptContent, AvsVideoColorspace forceColorSpace)
        {
            var clip = new AviSynthClip("Eval", scriptContent, forceColorSpace);

            return(new AviSynthFile(clip));
        }
        public AviSynthFile OpenAviSynthScriptFile(string scriptFileName, AvsVideoColorspace forceColorSpace)
        {
            var clip = new AviSynthClip("Import", scriptFileName, forceColorSpace);

            return(new AviSynthFile(clip));
        }