Example #1
0
        /// <summary>
        ///  Handles assessment of whether the encoding options vary between two xvidSettings instances
        /// The following are excluded from the comparison:
        /// BitrateQuantizer
        /// CreditsQuantizer
        /// Logfile
        /// PAR
        /// PARs
        /// SARX
        /// SARY
        /// Zones
        /// </summary>
        /// <param name="otherSettings"></param>
        /// <returns>true if the settings differ</returns>
        public bool IsAltered(VideoCodecSettings settings)
        {
            if (!(settings is DivXAVCSettings))
            {
                return(true);
            }
            DivXAVCSettings otherSettings = (DivXAVCSettings)settings;

            if (
                this.EncodingMode != otherSettings.EncodingMode ||
                this.AQO != otherSettings.AQO ||
                this.GOPLength != otherSettings.GOPLength ||
                this.MaxBFrames != otherSettings.MaxBFrames ||
                this.InterlaceMode != otherSettings.InterlaceMode ||
                this.MaxRefFrames != otherSettings.MaxRefFrames ||
                this.Pyramid != otherSettings.Pyramid ||
                this.BasRef != otherSettings.BasRef ||
                this.Turbo != otherSettings.Turbo
                )
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public static string genCommandline(string input, string output, Dar?d, DivXAVCSettings xs, int hres, int vres, Zone[] zones)
        {
            StringBuilder sb = new StringBuilder();
            CultureInfo   ci = new CultureInfo("en-us");

            sb.Append(" -i \"" + input + "\"");
            sb.Append(" -o \"" + output + "\"");

            switch (xs.EncodingMode)
            {
            case 0:                                                                                // 2pass - 1st pass
                sb.Append(" -npass 1 -sf " + "\"" + xs.Logfile + "\" -br " + xs.BitrateQuantizer); // add logfile
                break;

            case 1:                                                                                // 2pass - 2nd pass
            case 2:                                                                                // Automated 2 pass
                sb.Append(" -npass 2 -sf " + "\"" + xs.Logfile + "\" -br " + xs.BitrateQuantizer); // add logfile
                break;
            }

            double   framerate = 0.0;
            ulong    length    = 0;
            MainForm mainForm  = MainForm.Instance;

            if (!string.IsNullOrEmpty(mainForm.Video.VideoInput))
            {
                JobUtil.getInputProperties(out length, out framerate, mainForm.Video.VideoInput);
                sb.Append(" -fps " + framerate.ToString(ci));
            }

            if (xs.Turbo)
            {
                xs.AQO          = 0;
                xs.Pyramid      = false;
                xs.BasRef       = false;
                xs.MaxRefFrames = 1;
                xs.MaxBFrames   = 0;
            }

            if (xs.InterlaceMode != 0)
            {
                sb.Append(" -fmode " + xs.InterlaceMode);
            }
            if (xs.AQO != 1)
            {
                sb.Append(" -aqo " + xs.AQO);
            }
            if (xs.GOPLength != 4)
            {
                sb.Append(" -I " + xs.GOPLength);
            }
            if (xs.MaxBFrames != 2)
            {
                sb.Append(" -bf " + xs.MaxBFrames);
            }
            if (xs.MaxRefFrames != 4)
            {
                sb.Append(" -ref " + xs.MaxRefFrames);
            }
            if (xs.BasRef)
            {
                sb.Append(" -bref");
            }
            if (xs.Pyramid)
            {
                sb.Append(" -pyramid");
            }

            sb.Append(" -threads " + xs.NbThreads);

            return(sb.ToString());
        }