示例#1
0
 public AudioAvsWriter(string sourceFile, AvisynthConfig avsConfig, AudioInfo audioInfo)
 {
     this.avsConfig             = avsConfig;
     this.filters               = new OrderedDictionary <string, string>();
     this.loadingsAndImportings = new List <string>();
     this.audioInfo             = audioInfo;
     if (this.audioInfo.Format == "avs")
     {
         this.AvsInputInitialize(sourceFile);
     }
     else
     {
         this.SourceFilter = this.avsConfig.AudioSourceFilter;
         this.DownMix      = this.avsConfig.DownMix;
         this.Normalize    = this.avsConfig.Normalize;
     }
 }
示例#2
0
        public VideoAvsWriter(string sourceFile, AvisynthConfig avsConfig, string subtitleFile, VideoInfo videoInfo)
        {
            this.avsConfig = avsConfig;
            this.videoInfo = videoInfo;
            if (this.videoInfo.Container == "avs")
            {
                this.AvsInputInitialize(sourceFile);
            }
            else
            {
                this.SetSourceFilter(this.avsConfig.VideoSourceFilter);
                if (!this.avsConfig.UsingSourceFrameRate)
                {
                    this.SetFrameRate(this.avsConfig.FrameRate, this.avsConfig.ConvertFPS);
                }
                this.SetFilter("ConvertToYV12", "IsYV12 ? Last : ConvertToYV12()");
                if (!this.avsConfig.UsingSourceResolution && ((this.avsConfig.Width != this.videoInfo.Width) || (this.avsConfig.Height != this.videoInfo.Height)))
                {
                    if ((this.avsConfig.Width <= 0x3e8) && (this.videoInfo.Width >= 0x500))
                    {
                        string[] externalFilters = new string[] { Path.GetFullPath("ColorMatrix.dll") };
                        this.SetImport(externalFilters);
                        this.SetFilter("ColorMatrix", "ColorMatrix()");
                    }
                    this.SetFilter("Resizer", new StringBuilder().Append(this.avsConfig.Resizer).Append("(").Append(this.avsConfig.Width).Append(",").Append(this.avsConfig.Height).Append(")").ToString());
                }
                if (File.Exists(subtitleFile))
                {
                    string[] textArray2 = new string[] { Path.GetFullPath("VSFilter.dll") };
                    this.SetImport(textArray2);
                    string filter;
                    switch (Path.GetExtension(subtitleFile).ToLower())
                    {
                    case ".sub":
                    case ".idx": filter = "VobSub"; break;

                    default: filter = "TextSub"; break;
                    }
                    this.SetFilter(filter, filter + "(\"" + subtitleFile + "\")");
                }
            }
        }