Beispiel #1
0
        public FFV1(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            //прогружаем colorspace
            combo_color.Items.Add("YV12");
            combo_color.Items.Add("YUY2");
            combo_color.Items.Add("RGB32");
            combo_color.Items.Add("YUV410P");
            combo_color.Items.Add("YUV411P");
            combo_color.Items.Add("YUV444P");

            //codertype
            combo_codertype.Items.Add("VLC");
            combo_codertype.Items.Add("AC");

            //context model
            combo_contextmodel.Items.Add("Small");
            combo_contextmodel.Items.Add("Large");

            LoadFromProfile();
            SetToolTips();
        }
Beispiel #2
0
        public FFHUFF(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            //прогружаем fourcc
            combo_fourcc.Items.Add("HFYU");
            combo_fourcc.Items.Add("FFVH");

            //прогружаем colorspace
            combo_color.Items.Add("YV12");
            combo_color.Items.Add("YUY2");
            combo_color.Items.Add("RGB32");

            //предиктор
            combo_predictor.Items.Add("Left");
            combo_predictor.Items.Add("Plane");
            combo_predictor.Items.Add("Median");

            LoadFromProfile();
            SetToolTips();
        }
        public FormatSettings(Format.ExportFormats format, MainWindow parent)
        {
            this.InitializeComponent();
            this.Owner = parent;

            //Дефолты
            this.format = format;
            this.def = Formats.GetDefaults(format);

            //Включаем\выключаем редактирование
            //Video
            textbox_vcodecs.IsEnabled = def.VCodecs_IsEditable;
            textbox_framerates.IsEnabled = def.Framerates_IsEditable;
            combo_MinResolutionW.IsEnabled = combo_MinResolutionH.IsEnabled =
                combo_MidResolutionW.IsEnabled = combo_MidResolutionH.IsEnabled =
                combo_MaxResolutionW.IsEnabled = combo_MaxResolutionH.IsEnabled =
                combo_ValidModW.IsEnabled = combo_ValidModH.IsEnabled = def.Resolution_IsEditable;
            textbox_aspects.IsEnabled = def.Aspects_IsEditable;
            combo_fix_ar_method.IsEnabled = (def.LockedAR_Methods.Length > 1);
            check_anamorphic.IsEnabled = def.Anamorphic_IsEditable;
            check_interlaced.IsEnabled = def.Interlaced_IsEditable;

            //Audio
            textbox_acodecs.IsEnabled = def.ACodecs_IsEditable;
            textbox_samplerates.IsEnabled = def.Samplerates_IsEditable;
            check_stereo.IsEnabled = def.LimitedToStereo_IsEditable;

            //Muxing
            combo_Muxer.IsEnabled = (def.Muxers.Length > 1);
            combo_Extension.IsEnabled = (def.Extensions.Length > 1);
            combo_split.IsEnabled = (def.Splitting != "None");
            check_dont_mux.IsEnabled = def.DontMuxStreams_IsEditable;
            check_direct_encoding.IsEnabled = def.DirectEncoding_IsEditable;
            check_direct_remux.IsEnabled = def.DirectRemuxing_IsEditable;
            check_4gb_only.IsEnabled = def.LimitedTo4Gb_IsEditable;

            //Переводим фокус
            int active_tab = 0;
            if (int.TryParse(Settings.GetFormatPreset(format, "ActiveTab"), out active_tab))
            {
                if (active_tab == 2) tab_audio.IsSelected = true;
                else if (active_tab == 3) tab_muxing.IsSelected = true;
            }

            LoadSettings();
            TranslateItems();
            SetTooltips();

            //Предупреждение (один раз для каждого формата)
            if (format != Format.ExportFormats.Custom && !Convert.ToBoolean(Settings.GetFormatPreset(format, "was_warned")))
            {
                Message mes = new Message(parent);
                mes.ShowMessage(Languages.Translate("Some options or their combinations may not work as you expect!") + "\r\n" +
                    Languages.Translate("After making any changes the format may become completely broken!"), Languages.Translate("Warning"), Message.MessageStyle.Ok);
                Settings.SetFormatPreset(format, "was_warned", bool.TrueString);
            }

            ShowDialog();
        }
Beispiel #4
0
        public Filtering(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();
            this.Owner = this.p = parent;

            if (mass != null)
            {
                m = mass.Clone();
                script_box.Text = m.script;

                button_refresh.Content = Languages.Translate("Apply");
                button_refresh.ToolTip = Languages.Translate("Refresh preview");
                button_fullscreen.ToolTip = Languages.Translate("Fullscreen mode");
                button_Avsp.ToolTip = Languages.Translate("AvsP editor");
            }
            else
            {
                old_filtering = Settings.Filtering;

                grid_profiles.Visibility = Visibility.Visible;
                button_refresh.Visibility = button_fullscreen.Visibility = button_Avsp.Visibility = Visibility.Collapsed;
                text_profile.Content = Languages.Translate("Profile:");
                button_add.ToolTip = Languages.Translate("Add profile");
                button_remove.ToolTip = Languages.Translate("Remove profile");

                LoadProfiles();
                LoadPreset();
            }

            //переводим
            Title = Languages.Translate("Filtering");
            button_ok.Content = Languages.Translate("OK");
            button_ok.ToolTip = Languages.Translate("Save changes");
            button_cancel.Content = button_cancel.ToolTip = Languages.Translate("Cancel");

            //Ограничиваем максимальную ширину окна до его открытия
            this.MaxWidth = Math.Min(((MainWindow)parent).ActualWidth * 1.25, SystemParameters.WorkArea.Width);
            this.SizeChanged += new SizeChangedEventHandler(Window_SizeChanged);

            ShowDialog();
        }
Beispiel #5
0
        public AudioOptions(Massive mass, MainWindow parent, AudioOptionsModes mode)
        {
            this.InitializeComponent();

            this.mode = mode;
            p = parent;
            Owner = p;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //загружаем фарш в форму
            Reload(mass);

            //прописываем события
            this.num_delay.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_delay_ValueChanged);

            if (mode == AudioOptionsModes.AllOptions)
                Show();
            else
                ShowDialog();
        }
Beispiel #6
0
        public FDV(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            //прогружаем fourcc
            combo_fourcc.Items.Add("dvsd");
            combo_fourcc.Items.Add("DVSD");
            combo_fourcc.Items.Add("dv25");
            combo_fourcc.Items.Add("DV25");
            combo_fourcc.Items.Add("dv50");
            combo_fourcc.Items.Add("DV50");

            //прогружаем пресеты
            combo_preset.Items.Add("DVCAM");
            combo_preset.Items.Add("DVCPRO25");
            combo_preset.Items.Add("DVCPRO50");

            LoadFromProfile();
            SetToolTips();
        }
        public ColorCorrection(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();

            if (mass != null)
            {
                this.m = mass.Clone();
                this.oldm = mass.Clone();
            }
            else
            {
                //Заполняем массив
                m = new Massive();
                m.format = Settings.FormatOut;
                m.sbc = old_sbc = Settings.SBC;
                m = DecodeProfile(m);

                //Настройки гистограммы не хранятся в пресете
                combo_histogram.IsEnabled = false;
            }

            this.Owner = this.p = parent;

            //переводим
            Title = Languages.Translate("Color correction");
            text_profile.Content = Languages.Translate("Profile:");
            button_apply.Content = Languages.Translate("Apply");
            button_apply.ToolTip = Languages.Translate("Refresh preview");
            button_cancel.Content = Languages.Translate("Cancel");
            //button_fullscreen.Content = Languages.Translate("Fullscreen");
            button_ok.Content = Languages.Translate("OK");
            button_add.ToolTip = Languages.Translate("Add profile");
            button_remove.ToolTip = Languages.Translate("Remove profile");
            text_brightness.Content = Languages.Translate("Brightness") + ":";
            text_saturation.Content = Languages.Translate("Saturation") + ":";
            text_contrast.Content = Languages.Translate("Contrast") + ":";
            text_hue.Content = Languages.Translate("Hue") + ":";
            text_histogram.Content = Languages.Translate("Histogram") + ":";

            //AviSynth 2.6+
            if (SysInfo.AVSVersionFloat >= 2.6f)
            {
                check_dithering.IsEnabled = true;
                check_dithering.ToolTip = Languages.Translate("Apply dithering to prevent banding");
            }
            else
            {
                check_dithering.IsEnabled = false;
                check_dithering.ToolTip = Languages.Translate("AviSynth 2.6+ is required");
            }

            check_fullrange.ToolTip = Languages.Translate("Do not clip luma and chroma to TV levels");

            combo_brightness.ToolTip = Languages.Translate("Is used to change the brightness of the image.") + Environment.NewLine +
               Languages.Translate("Positive values increase the brightness.") + Environment.NewLine +
               Languages.Translate("Negative values decrease the brightness.");

            combo_hue.ToolTip = Languages.Translate("Is used to adjust the color hue of the image.") + Environment.NewLine +
                Languages.Translate("Positive values shift the image towards red.") + Environment.NewLine +
                Languages.Translate("Negative values shift it towards green.");

            combo_contrast.ToolTip = Languages.Translate("Is used to change the contrast of the image.") + Environment.NewLine +
                Languages.Translate("Values above 1.0 increase the contrast.") + Environment.NewLine +
                Languages.Translate("Values below 1.0 decrease the contrast.");

            combo_saturation.ToolTip = Languages.Translate("Is used to adjust the color saturation of the image.") + Environment.NewLine +
                Languages.Translate("Values above 1.0 increase the saturation.") + Environment.NewLine +
                Languages.Translate("Values below 1.0 reduce the saturation.");

            //забиваем параметры
            //Цветность
            for (double n = 0.0; n <= 10.0; n += 0.1)
                combo_saturation.Items.Add(n.ToString("0.0").Replace(",", "."));
            slider_saturation.Minimum = 0.0;
            slider_saturation.Maximum = 10.0;
            slider_saturation.SmallChange = 0.1;

            //Контрастность
            for (double n = 0.0; n <= 5.0; n += 0.01)
                combo_contrast.Items.Add(n.ToString("0.00").Replace(",", "."));
            slider_contrast.Minimum = 0.0;
            slider_contrast.Maximum = 5.0;
            slider_contrast.SmallChange = 0.01;

            //Оттенок
            for (int n = -180; n <= 180; n++)
                combo_hue.Items.Add(n);
            slider_hue.Minimum = -180;
            slider_hue.Maximum = 180;
            slider_hue.SmallChange = 1;

            //Яркость
            for (int n = -255; n <= 255; n++)
                combo_brightness.Items.Add(n);
            slider_brightness.Minimum = -255;
            slider_brightness.Maximum = 255;
            slider_brightness.SmallChange = 1;

            //Возможные типы гистограммы
            combo_histogram.Items.Add("Disabled");
            combo_histogram.Items.Add("Classic");
            combo_histogram.Items.Add("Levels");
            combo_histogram.Items.Add("Color");
            combo_histogram.Items.Add("Color2");
            combo_histogram.Items.Add("Luma");
            combo_histogram.Items.Add("Stereo");
            combo_histogram.Items.Add("StereoOverlay");
            combo_histogram.Items.Add("AudioLevels");
            combo_histogram.SelectedItem = (oldm != null) ? oldm.histogram : "Disabled";

            LoadProfiles();    //загружает список профилей в форму, название текущего профиля выбирается = m.sbc
            LoadFromProfile(); //загружает параметры в форму (из массива m)

            ShowDialog();
        }
Beispiel #8
0
        public x264(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.root_window = VideoEncWindow;
            this.p = parent;

            //Mode
            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("Constant Quantizer");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("3-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            combo_mode.Items.Add("3-Pass Size");

            //AVC profile
            combo_avc_profile.Items.Add(new ComboBoxItem { Content = "Auto" });
            combo_avc_profile.Items.Add("Baseline Profile");
            combo_avc_profile.Items.Add("Main Profile");
            combo_avc_profile.Items.Add("High Profile");
            combo_avc_profile.Items.Add("High 10 Profile");

            //AVC level
            combo_level.Items.Add("Unrestricted");
            combo_level.Items.Add("1.0");
            combo_level.Items.Add("1.1");
            combo_level.Items.Add("1.2");
            combo_level.Items.Add("1.3");
            combo_level.Items.Add("2.0");
            combo_level.Items.Add("2.1");
            combo_level.Items.Add("2.2");
            combo_level.Items.Add("3.0");
            combo_level.Items.Add("3.1");
            combo_level.Items.Add("3.2");
            combo_level.Items.Add("4.0");
            combo_level.Items.Add("4.1");
            combo_level.Items.Add("4.2");
            combo_level.Items.Add("5.0");
            combo_level.Items.Add("5.1");
            combo_level.Items.Add("5.2");

            //Tune
            combo_tune.Items.Add("None");
            combo_tune.Items.Add("Film");
            combo_tune.Items.Add("Animation");
            combo_tune.Items.Add("Grain");
            combo_tune.Items.Add("Still Image");
            combo_tune.Items.Add("PSNR");
            combo_tune.Items.Add("SSIM");
            combo_tune.Items.Add("Fast Decode");

            //Adaptive Quantization
            for (double n = 0.1; n <= 2.1; n += 0.1)
                combo_adapt_quant.Items.Add(Calculate.ConvertDoubleToPointString(n, 1));

            combo_adapt_quant_mode.Items.Add("None");
            combo_adapt_quant_mode.Items.Add("VAQ");
            combo_adapt_quant_mode.Items.Add("A-VAQ");

            //прогружаем деблокинг
            for (int n = -6; n <= 6; n++)
            {
                combo_dstrength.Items.Add(n);
                combo_dthreshold.Items.Add(n);
            }

            //Прописываем subme
            combo_subme.Items.Add("0 - Fullpel only");
            combo_subme.Items.Add("1 - QPel SAD");
            combo_subme.Items.Add("2 - QPel SATD");
            combo_subme.Items.Add("3 - HPel on MB then QPel");
            combo_subme.Items.Add("4 - Always QPel");
            combo_subme.Items.Add("5 - QPel & Bidir ME");
            combo_subme.Items.Add("6 - RD on I/P frames");
            combo_subme.Items.Add("7 - RD on all frames");
            combo_subme.Items.Add("8 - RD refinement on I/P frames");
            combo_subme.Items.Add("9 - RD refinement on all frames");
            combo_subme.Items.Add("10 - QP-RD");
            combo_subme.Items.Add("11 - Full RD");

            //прописываем me алгоритм
            combo_me.Items.Add("Diamond");
            combo_me.Items.Add("Hexagon");
            combo_me.Items.Add("Multi Hexagon");
            combo_me.Items.Add("Exhaustive");
            combo_me.Items.Add("SATD Exhaustive");

            //прописываем me range
            for (int n = 4; n <= 64; n++)
                combo_merange.Items.Add(n);

            //B фреймы
            for (int n = 0; n <= 16; n++)
                combo_bframes.Items.Add(n);

            //режим B фреймов
            combo_bframe_mode.Items.Add("Disabled");
            combo_bframe_mode.Items.Add("Spatial");
            combo_bframe_mode.Items.Add("Temporal");
            combo_bframe_mode.Items.Add("Auto");

            //trellis
            combo_trellis.Items.Add("0 - Disabled");
            combo_trellis.Items.Add("1 - Final MB");
            combo_trellis.Items.Add("2 - Always");

            //refernce frames
            for (int n = 1; n <= 16; n++)
                combo_ref.Items.Add(n);

            combo_open_gop.Items.Add("No");
            combo_open_gop.Items.Add("Yes");

            //Кол-во потоков для lookahead
            combo_lookahead_threads.Items.Add("Auto");
            for (int n = 1; n <= 10; n++)
                combo_lookahead_threads.Items.Add(Convert.ToString(n));

            //Кол-во потоков для x264-го
            combo_threads_count.Items.Add("Auto");
            combo_threads_count.Items.Add("1");
            combo_threads_count.Items.Add("1+1"); //+ --thread-input
            for (int n = 2; n <= 32; n++)
                combo_threads_count.Items.Add(Convert.ToString(n));

            //-b-adapt
            combo_badapt_mode.Items.Add("Disabled");
            combo_badapt_mode.Items.Add("Fast");
            combo_badapt_mode.Items.Add("Optimal");

            //--b-pyramid
            combo_bpyramid_mode.Items.Add("None");
            combo_bpyramid_mode.Items.Add("Strict");
            combo_bpyramid_mode.Items.Add("Normal");

            //--weightp
            combo_weightp_mode.Items.Add("Disabled");
            combo_weightp_mode.Items.Add("Blind offset");
            combo_weightp_mode.Items.Add("Smart analysis");

            combo_nal_hrd.Items.Add("None");
            combo_nal_hrd.Items.Add("VBR");
            combo_nal_hrd.Items.Add("CBR");

            combo_range_in.Items.Add("Auto");
            combo_range_in.Items.Add("TV");
            combo_range_in.Items.Add("PC");

            combo_range_out.Items.Add("Auto");
            combo_range_out.Items.Add("TV");
            combo_range_out.Items.Add("PC");

            combo_colorprim.Items.Add("Undefined");
            combo_colorprim.Items.Add("bt709");
            combo_colorprim.Items.Add("bt470m");
            combo_colorprim.Items.Add("bt470bg");
            combo_colorprim.Items.Add("smpte170m");
            combo_colorprim.Items.Add("smpte240m");
            combo_colorprim.Items.Add("film");

            combo_transfer.Items.Add("Undefined");
            combo_transfer.Items.Add("bt709");
            combo_transfer.Items.Add("bt470m");
            combo_transfer.Items.Add("bt470bg");
            combo_transfer.Items.Add("linear");
            combo_transfer.Items.Add("log100");
            combo_transfer.Items.Add("log316");
            combo_transfer.Items.Add("smpte170m");
            combo_transfer.Items.Add("smpte240m");

            combo_colormatrix.Items.Add("Undefined");
            combo_colormatrix.Items.Add("bt709");
            combo_colormatrix.Items.Add("fcc");
            combo_colormatrix.Items.Add("bt470bg");
            combo_colormatrix.Items.Add("smpte170m");
            combo_colormatrix.Items.Add("smpte240m");
            combo_colormatrix.Items.Add("GBR");
            combo_colormatrix.Items.Add("YCgCo");

            combo_colorspace.Items.Add("I420");
            combo_colorspace.Items.Add("I422");
            combo_colorspace.Items.Add("I444");
            combo_colorspace.Items.Add("RGB");

            text_mode.Content = Languages.Translate("Encoding mode") + ":";
            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            x264_help.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            x264_help.ToolTip = "Show x264.exe --fullhelp screen";

            LoadFromProfile();
        }
        public VideoEncoding(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();

            if (mass != null)
            {
                this.m = mass.Clone();
                this.oldm = mass.Clone();
            }
            else
            {
                //Заполняем массив
                m = new Massive();
                m.format = Settings.FormatOut;
                m.vencoding = old_vencoding = Settings.GetVEncodingPreset(m.format);
                m.outvcodec = PresetLoader.GetVCodec(m);
                m.vpasses = PresetLoader.GetVCodecPasses(m);
                m = PresetLoader.DecodePresets(m);
                m.infilepath = "C:\\file.mkv";
                m.invcodecshort = "NOINPUT";
                m.inresw = m.outresw = 640;
                m.inresh = m.outresh = 480;
                m.induration = m.outduration = TimeSpan.FromMinutes(1);
                m.inframerate = m.outframerate = "25.000";
                m.inframes = m.outframes = 1000;
                m.infilesizeint = 1000;
                m.invbitrate = 1000;

                //Убираем лишнее, т.к. всё-равно показывать там нечего
                text_insize_value.Visibility = text_outsize_value.Visibility = Visibility.Collapsed;
                text_inquality_value.Visibility = text_outquality_value.Visibility = Visibility.Collapsed;
                text_codec.Margin = text_incodec_value.Margin = combo_codec.Margin = new Thickness(16, 8, 16, 8);
                row2.Height = row3.Height = new GridLength(0);
            }

            this.Owner = this.p = parent;

            //загружаем список кодеков соответвующий формату
            foreach (string codec in Format.GetVCodecsList(m.format)) combo_codec.Items.Add(codec);
            combo_codec.Items.Add("Copy");
            if (!combo_codec.Items.Contains(m.outvcodec)) combo_codec.Items.Add(m.outvcodec);
            combo_codec.SelectedItem = m.outvcodec;
            text_incodec_value.Content = m.invcodecshort;
            text_insize_value.Content = m.infilesize;
            text_outsize_value.Content = m.outfilesize = Calculate.GetEncodingSize(m);

            //загружаем правильную страницу
            LoadCodecWindow();

            //переводим
            Title = Languages.Translate("Video encoding settings");
            text_size.Content = Languages.Translate("Size") + ":";
            text_codec.Content = Languages.Translate("Codec") + ":";
            text_quality.Content = Languages.Translate("Quality") + ":";
            text_profile.Content = Languages.Translate("Profile:");
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            button_add.ToolTip = Languages.Translate("Add profile");
            button_remove.ToolTip = Languages.Translate("Remove profile");

            //bit-pixels calculation
            text_inquality_value.Content = Calculate.GetQualityIn(m);
            text_outquality_value.Content = Calculate.GetQualityOut(m, true);

            LoadProfiles();

            ShowDialog();
        }
Beispiel #10
0
        public FMPEG4(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.num_bitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bitrate_ValueChanged);
            this.num_bittolerance.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bittolerance_ValueChanged);
            this.num_buffsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_buffsize_ValueChanged);
            this.num_gopsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_gopsize_ValueChanged);
            this.num_maxbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_maxbitrate_ValueChanged);
            this.num_minbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_minbitrate_ValueChanged);

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            //combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            //combo_mode.Items.Add("3-Pass Size");

            //Прописываем ME метод
            #region
            //(me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size)
            //http://forum.doom9.org/showthread.php?t=157282
            //log, phods, and x1 don't exist. -dia_size 1040 means “exhaustive search of radius 16″, or in x264, –me esa –merange 16
            /*motion_estimation_template.c  (0 2 4 5 514 1040 1285)

            if(c->dia_size==-1)        funny_diamond_search
            else if(c->dia_size<-1)    sab_diamond_search
            else if(c->dia_size<2)     small_diamond_search
            else if(c->dia_size>1024)  full_search
            else if(c->dia_size>768)   umh_search
            else if(c->dia_size>512)   hex_search
            else if(c->dia_size>256)   l2s_dia_search
            else                       var_diamond_search
             */
            /*
             * -x..-2     sab_diamond_search
             * -1         funny_diamond_search
             * 0..1       small_diamond_search
             * 2..256     var_diamond_search
             * 257..512   l2s_dia_search
             * 513..768   hex_search
             * 769..1024  umh_search
             * 1025..     full_search
             *
             * 0    5s  11.08
             * 1    5s  11.08
             * 2-   5s  10.97
             * 3    6s  10.90
             * 4    7s  10.89
             * 5    8s  10.86 MAP
             * 10  17s  10.80
             * 15  33s  10.75
             * 256-доооооолго
             * 257  5s  10.97
             * 258  6s  10.88
             * 260  7s  10.83
             * 261  7s  10.81 MAP
             * -2   6s  10.98
             * -4   6s  10.91
             * -5   7s  10.90
             */
            #endregion
            combo_me_method.Items.Add("Small"); //0..1
            combo_me_method.Items.Add("Sab"); //-x..-2
            combo_me_method.Items.Add("Funny"); //-1
            combo_me_method.Items.Add("Var"); //2..256
            combo_me_method.Items.Add("L2s"); //257..512
            combo_me_method.Items.Add("HEX"); //513..768
            combo_me_method.Items.Add("UMH"); //769..1024
            combo_me_method.Items.Add("Full"); //1025..x

            //прописываем cmp
            combo_cmp.Items.Add("SAD");
            combo_cmp.Items.Add("SSE");
            combo_cmp.Items.Add("SATD");
            combo_cmp.Items.Add("DCT");
            combo_cmp.Items.Add("PSNR");
            combo_cmp.Items.Add("BIT");
            combo_cmp.Items.Add("RD");
            combo_cmp.Items.Add("ZERO");
            combo_cmp.Items.Add("VSAD");
            combo_cmp.Items.Add("VSSE");
            combo_cmp.Items.Add("NSSE");

            //прогружаем матрицы квантизации
            combo_qmatrix.Items.Add("H263");
            foreach (string matrix in PresetLoader.CustomMatrixes(MatrixTypes.TXT))
                combo_qmatrix.Items.Add(matrix);

            //прогружаем fourcc
            combo_fourcc.Items.Add("");
            combo_fourcc.Items.Add("Default");
            combo_fourcc.Items.Add("XVID");
            combo_fourcc.Items.Add("FFDS");
            combo_fourcc.Items.Add("FVFW");
            combo_fourcc.Items.Add("DX50");
            combo_fourcc.Items.Add("DIVX");
            combo_fourcc.Items.Add("MP4V");

            //прогружаем mbd
            combo_mbd.Items.Add("Simple");
            combo_mbd.Items.Add("Fewest bits");
            combo_mbd.Items.Add("Rate distortion");

            //B фреймы
            for (int n = 0; n <= 16; n++)
                combo_bframes.Items.Add(n);

            combo_bdecision.Items.Add("Disabled");
            for (int n = 1; n <= 10; n++)
                combo_bdecision.Items.Add(n.ToString());

            combo_brefine.Items.Add("Disabled");
            for (int n = 1; n <= 4; n++)
                combo_brefine.Items.Add(n.ToString());

            //пресеты настроек и качества
            foreach (string preset in Enum.GetNames(typeof(CodecPresets)))
                combo_codec_preset.Items.Add(preset);

            combo_threads.Items.Add("Auto");
            for (int n = 1; n <= 32; n++)
                combo_threads.Items.Add(n);

            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            Help_CLI.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            Help_CLI.ToolTip = "Show ffmpeg.exe -help full screen";

            LoadFromProfile();
        }
Beispiel #11
0
        public FLV1(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.num_bitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bitrate_ValueChanged);
            this.num_bittolerance.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bittolerance_ValueChanged);
            this.num_buffsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_buffsize_ValueChanged);
            this.num_gopsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_gopsize_ValueChanged);
            this.num_maxbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_maxbitrate_ValueChanged);
            this.num_minbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_minbitrate_ValueChanged);

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            //combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            //combo_mode.Items.Add("3-Pass Size");

            //Прописываем ME метод
            combo_me_method.Items.Add("Small"); //0..1
            combo_me_method.Items.Add("Sab"); //-x..-2
            combo_me_method.Items.Add("Funny"); //-1
            combo_me_method.Items.Add("Var"); //2..256
            combo_me_method.Items.Add("L2s"); //257..512
            combo_me_method.Items.Add("HEX"); //513..768
            combo_me_method.Items.Add("UMH"); //769..1024
            combo_me_method.Items.Add("Full"); //1025..x

            //прописываем cmp
            combo_cmp.Items.Add("SAD");
            combo_cmp.Items.Add("SSE");
            combo_cmp.Items.Add("SATD");
            combo_cmp.Items.Add("DCT");
            combo_cmp.Items.Add("PSNR");
            combo_cmp.Items.Add("BIT");
            combo_cmp.Items.Add("RD");
            combo_cmp.Items.Add("ZERO");
            combo_cmp.Items.Add("VSAD");
            combo_cmp.Items.Add("VSSE");
            combo_cmp.Items.Add("NSSE");

            //прогружаем матрицы квантизации
            combo_qmatrix.Items.Add("H263");
            foreach (string matrix in PresetLoader.CustomMatrixes(MatrixTypes.TXT))
                combo_qmatrix.Items.Add(matrix);

            //прогружаем fourcc
            combo_fourcc.Items.Add("");
            combo_fourcc.Items.Add("Default");
            combo_fourcc.Items.Add("FLV1");

            //прогружаем mbd
            combo_mbd.Items.Add("Simple");
            combo_mbd.Items.Add("Fewest bits");
            combo_mbd.Items.Add("Rate distortion");

            //пресеты настроек и качества
            foreach (string preset in Enum.GetNames(typeof(CodecPresets)))
                combo_codec_preset.Items.Add(preset);

            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            Help_CLI.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            Help_CLI.ToolTip = "Show ffmpeg.exe -help full screen";

            LoadFromProfile();
        }
Beispiel #12
0
        public Encoder(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();
            this.Owner = this.p = parent;
            this.m = mass.Clone();

            button_info.Visibility = Visibility.Hidden;
            button_play.Visibility = Visibility.Hidden;

            button_play.Content = Languages.Translate("Play");
            button_info.Content = Languages.Translate("Info");

            //Прячем окно, если программа минимизирована или свернута в трей
            if (!p.IsVisible || p.WindowState == WindowState.Minimized)
            {
                this.Hide();
                this.Name = "Hidden";
                this.ActiveHandle = p.Handle;
            }
            else
            {
                this.Show();
                this.ActiveHandle = new System.Windows.Interop.WindowInteropHelper(this).Handle;
            }

            this.IsVisibleChanged += new DependencyPropertyChangedEventHandler(Encoder_IsVisibleChanged);

            //Путь может измениться
            outpath_src = m.outfilepath;

            //А эти параметры вроде бы не меняются
            IsDirectRemuxingPossible = Format.IsDirectRemuxingPossible(m);
            DontMuxStreams = Format.GetMultiplexing(m.format);
            Splitting = Format.GetSplitting(m.format);
            muxer = Format.GetMuxer(m);

            //видео кодирование
            if (m.vencoding == "Copy") steps++;
            else steps = m.vpasses.Count;

            //аудио кодирование
            if (m.outaudiostreams.Count > 0)
            {
                if (muxer != Format.Muxers.Disabled || DontMuxStreams || m.format == Format.ExportFormats.Audio)
                    steps++;

                string codec = ((AudioStream)(m.outaudiostreams[m.outaudiostream])).codec;
                if (codec == "AAC")
                {
                    if (m.aac_options.encodingmode == Settings.AudioEncodingModes.TwoPass) steps++; //Два прохода
                    //if (muxer == Format.Muxers.tsmuxer) steps++; //Извлечение aac из m4a (видимо оно больше не нужно)
                }
                else if (codec == "QAAC")
                {
                    //if (muxer == Format.Muxers.tsmuxer) steps++; //Извлечение aac из m4a (видимо оно больше не нужно)
                }
                else if (codec == "Copy" && Settings.CopyDelay) CopyDelay = true;
            }

            //муксинг
            if (muxer == Format.Muxers.pmpavc)
            {
                steps++;
                steps++;
                steps++;
                steps++;
            }
            else if (muxer != Format.Muxers.Disabled && muxer != 0 && !DontMuxStreams)
                steps++;

            //точка отсчёта
            step--;

            //забиваем
            SetMaximum(m.outframes);

            combo_ending.Items.Clear();
            combo_ending.Items.Add(Languages.Translate("Wait"));
            combo_ending.Items.Add(Languages.Translate("Standby"));
            if (PowerManagementNativeMethods.IsPowerHibernateAllowed())
                combo_ending.Items.Add(Languages.Translate("Hibernate"));
            combo_ending.Items.Add(Languages.Translate("Shutdown"));
            combo_ending.Items.Add(Languages.Translate("Exit"));
            combo_ending.SelectedItem = Languages.Translate(ending.ToString());
            combo_ending.ToolTip = Languages.Translate("Final action");

            //фоновое кодирование
            CreateBackgoundWorker();
            worker.RunWorkerAsync();
        }
Beispiel #13
0
        public FMPEG2(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.num_bitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bitrate_ValueChanged);
            this.num_bittolerance.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bittolerance_ValueChanged);
            this.num_buffsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_buffsize_ValueChanged);
            this.num_gopsize.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_gopsize_ValueChanged);
            this.num_maxbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_maxbitrate_ValueChanged);
            this.num_minbitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_minbitrate_ValueChanged);

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            //combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            //combo_mode.Items.Add("3-Pass Size");

            //Прописываем ME метод
            //combo_me_method.Items.Add("ZERO");
            //combo_me_method.Items.Add("FULL");
            //combo_me_method.Items.Add("EPSZ");
            //combo_me_method.Items.Add("LOG");
            //combo_me_method.Items.Add("PHODS");
            //combo_me_method.Items.Add("X1");
            //combo_me_method.Items.Add("HEX");
            //combo_me_method.Items.Add("UMH");
            //combo_me_method.Items.Add("ITER");
            combo_me_method.Items.Add("Default Search"); //0
            combo_me_method.Items.Add("Sab Diamond Search"); //-2-
            combo_me_method.Items.Add("Funny Diamond Search"); //-1
            combo_me_method.Items.Add("Small Diamond Search"); //2+
            combo_me_method.Items.Add("L2s Diamond Search"); //257+
            combo_me_method.Items.Add("HEX Search"); //513+
            combo_me_method.Items.Add("UMH Search"); //769+
            combo_me_method.Items.Add("Full Search"); //1025+

            //прописываем cmp
            combo_cmp.Items.Add("SAD");
            combo_cmp.Items.Add("SSE");
            combo_cmp.Items.Add("SATD");
            combo_cmp.Items.Add("DCT");
            combo_cmp.Items.Add("PSNR");
            combo_cmp.Items.Add("BIT");
            combo_cmp.Items.Add("RD");
            combo_cmp.Items.Add("ZERO");
            combo_cmp.Items.Add("VSAD");
            combo_cmp.Items.Add("VSSE");
            combo_cmp.Items.Add("NSSE");
            //combo_cmp.Items.Add("W53");
            //combo_cmp.Items.Add("W97");

            //прогружаем матрицы квантизации
            combo_qmatrix.Items.Add("H263");
            foreach (string matrix in PresetLoader.CustomMatrixes(MatrixTypes.TXT))
                combo_qmatrix.Items.Add(matrix);

            //прогружаем fourcc
            combo_fourcc.Items.Add("MPEG");
            combo_fourcc.Items.Add("MPG2");

            //прогружаем векторы
            combo_mvectors.Items.Add("Disabled");
            combo_mvectors.Items.Add("MV0");
            combo_mvectors.Items.Add("MV4");
            combo_mvectors.Items.Add("Unlimited");

            //прогружаем mbd
            combo_mbd.Items.Add("Simple");
            combo_mbd.Items.Add("Fewest bits");
            combo_mbd.Items.Add("Rate distortion");

            //B фреймы
            for (int n = 0; n <= 16; n++)
                combo_bframes.Items.Add(n);

            combo_bdecision.Items.Add("Disabled");
            for (int n = 0; n <= 10; n++)
                combo_bdecision.Items.Add(n.ToString());

            combo_brefine.Items.Add("Disabled");
            for (int n = 0; n <= 4; n++)
                combo_brefine.Items.Add(n.ToString());

            //пресеты настроек и качества
            foreach (string preset in Enum.GetNames(typeof(CodecPresets)))
                combo_codec_preset.Items.Add(preset);

            LoadFromProfile();
        }
Beispiel #14
0
        public AudioEncoding(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();

            if (mass != null)
            {
                this.m = mass.Clone();
                this.oldm = mass.Clone();
            }
            else
            {
                //Заполняем массив
                m = new Massive();
                m.format = Settings.FormatOut;
                m.infilepath = "C:\\file.mkv";

                //Добавляем звук
                m.inaudiostreams.Add(new AudioStream());
                m.outaudiostreams.Add(new AudioStream());
                m.inaudiostream = m.outaudiostream = 0;

                //Убираем лишнее, т.к. всё-равно показывать там нечего
                text_insize_value.Visibility = text_outsize_value.Visibility = Visibility.Collapsed;
                text_codec.Margin = text_incodec_value.Margin = combo_codec.Margin = new Thickness(16, 8, 16, 8);
                row2.Height = new GridLength(0);
            }

            this.Owner = parent;

            //определяем аудио потоки
            AudioStream instream = (AudioStream)m.inaudiostreams[m.inaudiostream];
            AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];

            if (oldm == null)
            {
                //Заполняем параметры треков
                outstream.encoding = old_aencoding = Settings.GetAEncodingPreset(m.format);
                outstream.codec = PresetLoader.GetACodec(m.format, outstream.encoding);
                outstream.passes = PresetLoader.GetACodecPasses(m);
                instream.audiopath = "C:\\file.mp3";
                instream.codecshort = "NOINPUT";
                instream.bitrate = 128;
                instream.bits = outstream.bits = 16;
                instream.channels = outstream.channels = 2;
                instream.samplerate = outstream.samplerate = "44100";

                m = PresetLoader.DecodePresets(m);
            }

            //загружаем список кодеков соответвующий формату
            foreach (string codec in Format.GetACodecsList(m.format)) combo_codec.Items.Add(codec);
            if (oldm != null) combo_codec.Items.Add("Disabled");
            combo_codec.Items.Add("Copy");
            if (!combo_codec.Items.Contains(outstream.codec)) combo_codec.Items.Add(outstream.codec);
            combo_codec.SelectedItem = outstream.codec;
            text_incodec_value.Content = instream.codecshort;

            text_insize_value.Content = m.infilesize;
            text_outsize_value.Content = m.outfilesize = Calculate.GetEncodingSize(m);

            //загружаем правильную страницу
            LoadCodecWindow();

            //переводим
            Title = Languages.Translate("Audio encoding settings");
            text_size.Content = Languages.Translate("Size") + ":";
            text_codec.Content = Languages.Translate("Codec") + ":";
            text_profile.Content = Languages.Translate("Profile:");
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            button_add.ToolTip = Languages.Translate("Add profile");
            button_remove.ToolTip = Languages.Translate("Remove profile");

            LoadProfiles();

            ShowDialog();
        }
        public AspectResolution(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();

            if (mass != null)
            {
                m = mass.Clone();
                oldm = mass.Clone();
                format = mass.format;
            }
            else
                format = Settings.FormatOut;

            p = parent;
            Owner = p;

            //переводим
            string on = Languages.Translate("On");
            string off = Languages.Translate("Off");
            string _def = Languages.Translate("Default") + ": ";

            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            button_refresh.Content = button_manual_apply.Content = text_manual_apply.Content = Languages.Translate("Apply");
            button_refresh.ToolTip = Languages.Translate("Refresh preview");

            if (m != null) text_resolution.Content = m.inresw + "x" + m.inresh;
            text_source_res.Content = Languages.Translate("Input resolution:");
            text_final_res.Content = text_manual_res.Content = Languages.Translate("Output resolution:");
            text_resizer.Content = Languages.Translate("Resize filter:");
            text_aspectfix.Content = Languages.Translate("Aspect adjusting method:");
            combo_aspectfix.ToolTip = "SAR - " + Languages.Translate("fix AR using anamorphic encoding") + "\r\nCrop - " +
                Languages.Translate("fix AR by cropping the picture") + "\r\nBlack - " + Languages.Translate("fix AR by adding a black borders");
            text_inaspect.Content = Languages.Translate("Input aspect:");
            text_manual_outasp.Content = (text_outaspect.Content = Languages.Translate("Output aspect:")) + " | ";
            text_crop_tb.Content = text_manual_crop_tb.Content = Languages.Translate("Crop top, bottom:");
            text_crop_lr.Content = text_manual_crop_lr.Content = Languages.Translate("Crop left, right:");
            text_black.Content = text_manual_black.Content = Languages.Translate("Black width, height:");
            text_flip.Content = Languages.Translate("Flip horizontal, vertical:");
            combo_crop_b.ToolTip = manual_crop_b.ToolTip = Languages.Translate("Bottom");
            combo_crop_t.ToolTip = manual_crop_t.ToolTip = Languages.Translate("Top");
            combo_crop_l.ToolTip = manual_crop_l.ToolTip = Languages.Translate("Left");
            combo_crop_r.ToolTip = manual_crop_r.ToolTip = Languages.Translate("Right");
            combo_black_h.ToolTip = manual_black_h.ToolTip = Languages.Translate("Height");
            combo_black_w.ToolTip = manual_black_w.ToolTip = Languages.Translate("Width");
            combo_flip_v.ToolTip = Languages.Translate("Vertical");
            combo_flip_h.ToolTip = Languages.Translate("Horizontal");
            text_autocropframes.Content = Languages.Translate("Frames to analyze:");
            combo_autocropframes.ToolTip = _def + "11";
            text_autocropsens.Content = Languages.Translate("Autocrop sensivity:");
            combo_autocropsens.ToolTip = _def + "27";
            text_autocrop_new_mode.Content = Languages.Translate("Crop using the most common values") + ":";
            text_autocrop_new_mode.ToolTip = check_autocrop_new_mode.ToolTip = Languages.Translate("If checked, find the most common values for all the frames that`s being analyzed.") +
                "\r\n" + Languages.Translate("Otherwise find a minimum values only.") + "\r\n\r\n" + _def + off;
            text_aspecterror.Content = Languages.Translate("Aspect error:");
            text_recalculate.Content = Languages.Translate("Recalculate when cropping") + ":";
            text_recalculate.ToolTip = combo_recalculate.ToolTip = _def + Languages.Translate("Aspect");
            button_analyse.ToolTip = Languages.Translate("Autocrop black borders");
            button_vcrop.ToolTip = Languages.Translate("Crop black borders manually");
            button_analyse.Content = group_autocrop.Header = Languages.Translate("Auto crop");
            button_vcrop.Content = group_visualcrop.Header = Languages.Translate("Manual crop");
            tab_main.Header = Languages.Translate("Main");
            tab_settings.Header = Languages.Translate("Settings");
            Title = Languages.Translate("Resolution/Aspect");
            group_misc.Header = Languages.Translate("Misc");
            text_ffmpeg_ar.Content = Languages.Translate("Use FFmpeg AR info:");
            text_ffmpeg_ar.ToolTip = check_use_ffmpeg_ar.ToolTip = Languages.Translate("MediaInfo provides rounded values, so for better precision it`s recommended to use AR info from the FFmpeg") +
                ".\r\n" + Languages.Translate("This option is meaningful only when a file is opening.") + "\r\n\r\n" + _def + on;
            text_visualcrop_frame.Content = Languages.Translate("Startup frame:");
            combo_visualcrop_frame.ToolTip = _def + Languages.Translate("THM-frame");
            text_visualcrop_fullscreen.Content = Languages.Translate("Open window in fullscreen mode") + ":";
            manual_outaspect.ToolTip = Languages.Translate("In case of non-anamorphic encoding: Aspect = Width/Height.") +
                "\r\n" + Languages.Translate("In case of anamorphic encoding: Aspect = (Width/Height)*SAR.");
            manual_outsar.ToolTip = Languages.Translate("Leave it empty for non-anamorphic encoding.") +
                "\r\n" + Languages.Translate("For anamorphic encoding you must specify SAR.");
            button_calc_sar.ToolTip = Languages.Translate("Calculate SAR for specified output resolution and aspect.") +
                "\r\n" + Languages.Translate("It must be used for anamorphic encoding only!");
            text_original_ar.Content = Languages.Translate("Use the original AR of the stream (if available)") + ":";
            check_original_ar.ToolTip = text_original_ar.ToolTip = Languages.Translate("If checked, use the AR of the raw video stream instead of the AR of the container.") +
                "\r\n" + Languages.Translate("This option is meaningful only when a file is opening.") + "\r\n\r\n" + _def + on;

            for (int n = 0; n < 101; n++)
                combo_autocropsens.Items.Add(n);
            combo_autocropsens.SelectedItem = Settings.AutocropSensivity;

            for (int n = 5; n < 51; n++)
                combo_autocropframes.Items.Add(n);
            combo_autocropframes.SelectedItem = Settings.AutocropFrames;

            check_autocrop_new_mode.IsChecked = Settings.AutocropMostCommon;

            combo_visualcrop_frame.Items.Add(new ComboBoxItem() { Tag = "THM-frame", Content = Languages.Translate("THM-frame") });
            combo_visualcrop_frame.Items.Add(new ComboBoxItem() { Tag = "1-st frame", Content = Languages.Translate("1-st frame") });
            combo_visualcrop_frame.SelectedValue = Settings.VCropFrame;

            check_visualcrop_fullscreen.IsChecked = Settings.VCropFullscreen;

            combo_recalculate.Items.Add(new ComboBoxItem() { Tag = CropRecalculate.Nothing, Content = Languages.Translate(CropRecalculate.Nothing.ToString()) });
            combo_recalculate.Items.Add(new ComboBoxItem() { Tag = CropRecalculate.Aspect, Content = Languages.Translate(CropRecalculate.Aspect.ToString()) });
            combo_recalculate.Items.Add(new ComboBoxItem() { Tag = CropRecalculate.Everything, Content = Languages.Translate(CropRecalculate.Everything.ToString()) });
            combo_recalculate.SelectedValue = Settings.CropRecalculate;

            check_original_ar.IsChecked = Settings.MI_Original_AR;
            check_use_ffmpeg_ar.IsChecked = Settings.UseFFmpegAR;

            if (m != null)
            {
                //ресайзеры
                foreach (string resizer in Enum.GetNames(typeof(AviSynthScripting.Resizers)))
                    combo_resizer.Items.Add(resizer);
                combo_resizer.SelectedItem = m.resizefilter.ToString();

                //аспект фиксы
                foreach (string afix in Enum.GetNames(typeof(AspectFixes)))
                    combo_aspectfix.Items.Add(afix);
                combo_aspectfix.SelectedItem = m.aspectfix.ToString();

                string yes = Languages.Translate("Yes");
                combo_flip_v.Items.Add(yes);
                combo_flip_h.Items.Add(yes);

                string no = Languages.Translate("No");
                combo_flip_v.Items.Add(no);
                combo_flip_h.Items.Add(no);

                combo_flip_v.SelectedIndex = (m.flipv) ? 0 : 1;
                combo_flip_h.SelectedIndex = (m.fliph) ? 0 : 1;

                //Разрешения
                LoadResolutions();

                //входной аспект
                LoadInAspect();

                //обрезка
                LoadCrop();

                //поля
                LoadBlack();

                //загружаем выходной аспект
                LoadOutAspect();

                //Кратность сторон
                CalculateMod();

                //Вкладка Manual
                FillManualBox();
            }
            else
            {
                tab_main.IsEnabled = tab_manual.IsEnabled = false;
                tab_settings.IsSelected = true;
            }

            ShowDialog();
        }
Beispiel #16
0
        public x265(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.root_window = VideoEncWindow;
            this.p = parent;

            //https://github.com/videolan/x265/blob/master/source/x265cli.h - ключи CLI
            //https://github.com/videolan/x265/blob/master/source/common/param.cpp - парсинг ключей, Presets, Tunes

            //Mode
            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("Constant Quantizer");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("3-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            combo_mode.Items.Add("3-Pass Size");

            //HEVC profile
            combo_hevc_profile.Items.Add("Auto");
            combo_hevc_profile.Items.Add("Main");
            combo_hevc_profile.Items.Add("Main 444");
            combo_hevc_profile.Items.Add("Main 10b");
            combo_hevc_profile.Items.Add("Main 422 10b");
            combo_hevc_profile.Items.Add("Main 444 10b");

            //HEVC level
            combo_level.Items.Add("Unrestricted");
            combo_level.Items.Add("1.0");
            combo_level.Items.Add("2.0");
            combo_level.Items.Add("2.1");
            combo_level.Items.Add("3.0");
            combo_level.Items.Add("3.1");
            combo_level.Items.Add("4.0");
            combo_level.Items.Add("4.1");
            combo_level.Items.Add("5.0");
            combo_level.Items.Add("5.1");
            combo_level.Items.Add("5.2");
            combo_level.Items.Add("6.0");
            combo_level.Items.Add("6.1");
            combo_level.Items.Add("6.2");

            //Tune  psnr, ssim, grain, zero-latency, fast-decode
            combo_tune.Items.Add("None");
            combo_tune.Items.Add("Grain");
            combo_tune.Items.Add("PSNR");
            combo_tune.Items.Add("SSIM");
            combo_tune.Items.Add("Fast Decode");

            //Adaptive Quantization
            for (double n = 0.0; n <= 3.1; n += 0.1)
                combo_adapt_quant.Items.Add(Calculate.ConvertDoubleToPointString(n, 1));

            combo_adapt_quant_mode.Items.Add("None");
            combo_adapt_quant_mode.Items.Add("VAQ");
            combo_adapt_quant_mode.Items.Add("A-VAQ");

            //прогружаем деблокинг
            for (int n = -6; n <= 6; n++)
            {
                combo_dstrength.Items.Add(n);
                combo_dthreshold.Items.Add(n);
            }

            //Прописываем subme
            combo_subme.Items.Add("0 - least");
            combo_subme.Items.Add("1");
            combo_subme.Items.Add("2");
            combo_subme.Items.Add("3");
            combo_subme.Items.Add("4");
            combo_subme.Items.Add("5");
            combo_subme.Items.Add("6");
            combo_subme.Items.Add("7");
            combo_subme.Items.Add("8");
            combo_subme.Items.Add("9");
            combo_subme.Items.Add("10");
            combo_subme.Items.Add("11 - most");

            //прописываем me алгоритм
            combo_me.Items.Add("Diamond");
            combo_me.Items.Add("Hexagon");
            combo_me.Items.Add("Multi Hexagon");
            combo_me.Items.Add("Star");
            combo_me.Items.Add("Full");

            //прописываем me range
            for (int n = 4; n <= 512; n++)
                combo_merange.Items.Add(n);

            for (int i = 1; i < 6; i++)
                combo_max_merge.Items.Add(i);

            combo_rd.Items.Add("0 - least");
            for (int i = 1; i < 6; i++)
                combo_rd.Items.Add(i);
            combo_rd.Items.Add("6 - full RDO");

            combo_ctu.Items.Add(16);
            combo_ctu.Items.Add(32);
            combo_ctu.Items.Add(64);

            combo_max_tu.Items.Add(4);
            combo_max_tu.Items.Add(8);
            combo_max_tu.Items.Add(16);
            combo_max_tu.Items.Add(32);

            //B фреймы
            for (int n = 0; n <= 16; n++)
                combo_bframes.Items.Add(n);

            combo_bpyramid_mode.Items.Add("Disabled");
            combo_bpyramid_mode.Items.Add("Enabled");

            //refernce frames
            for (int n = 1; n <= 16; n++)
                combo_ref.Items.Add(n);

            combo_open_gop.Items.Add("No");
            combo_open_gop.Items.Add("Yes");

            //Кол-во потоков для x265-го
            combo_threads_count.Items.Add("Auto");
            combo_threads_frames.Items.Add("Auto");
            for (int n = 1; n <= 32; n++)
            {
                combo_threads_count.Items.Add(n);
                combo_threads_frames.Items.Add(n);
            }

            //-b-adapt
            combo_badapt_mode.Items.Add("None");
            combo_badapt_mode.Items.Add("Fast");
            combo_badapt_mode.Items.Add("Full");

            combo_range_out.Items.Add("Auto");
            combo_range_out.Items.Add("Limited");
            combo_range_out.Items.Add("Full");

            combo_colorprim.Items.Add("Undefined");
            combo_colorprim.Items.Add("bt709");
            combo_colorprim.Items.Add("bt470m");
            combo_colorprim.Items.Add("bt470bg");
            combo_colorprim.Items.Add("smpte170m");
            combo_colorprim.Items.Add("smpte240m");
            combo_colorprim.Items.Add("film");
            combo_colorprim.Items.Add("bt2020");

            combo_transfer.Items.Add("Undefined");
            combo_transfer.Items.Add("bt709");
            combo_transfer.Items.Add("bt470m");
            combo_transfer.Items.Add("bt470bg");
            combo_transfer.Items.Add("smpte170m");
            combo_transfer.Items.Add("smpte240m");
            combo_transfer.Items.Add("linear");
            combo_transfer.Items.Add("log100");
            combo_transfer.Items.Add("log316");
            combo_transfer.Items.Add("iec61966-2-4");
            combo_transfer.Items.Add("bt1361e");
            combo_transfer.Items.Add("iec61966-2-1");
            combo_transfer.Items.Add("bt2020-10");
            combo_transfer.Items.Add("bt2020-12");

            combo_colormatrix.Items.Add("Undefined");
            combo_colormatrix.Items.Add("bt709");
            combo_colormatrix.Items.Add("fcc");
            combo_colormatrix.Items.Add("bt470bg");
            combo_colormatrix.Items.Add("smpte170m");
            combo_colormatrix.Items.Add("smpte240m");
            combo_colormatrix.Items.Add("GBR");
            combo_colormatrix.Items.Add("YCgCo");
            combo_colormatrix.Items.Add("bt2020nc");
            combo_colormatrix.Items.Add("bt2020c");

            combo_hash.Items.Add("None");
            combo_hash.Items.Add("MD5");
            combo_hash.Items.Add("CRC");
            combo_hash.Items.Add("Checksum");

            text_mode.Content = Languages.Translate("Encoding mode") + ":";
            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            x265_help.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            x265_help.ToolTip = "Show x265.exe --fullhelp screen";

            LoadFromProfile();
        }
        private ArrayList raw_action = new ArrayList(); //Action, не переведенные

        #endregion Fields

        #region Constructors

        public Settings_Window(MainWindow parent, int set_focus_to)
        {
            this.InitializeComponent();
            this.Owner = this.p = parent;

            //переводим
            button_ok.Content = Languages.Translate("OK");
            Title = Languages.Translate("Settings") + ":";
            check_x264_psnr.ToolTip = Languages.Translate("Show x264 PSNR info");
            check_x264_ssim.ToolTip = Languages.Translate("Show x264 SSIM info");
            check_x262_psnr.ToolTip = check_x264_psnr.ToolTip.ToString().Replace("x264", "x262");
            check_x262_ssim.ToolTip = check_x264_ssim.ToolTip.ToString().Replace("x264", "x262");
            check_show_arguments.Content = Languages.Translate("Show encoding arguments");
            check_show_script.Content = Languages.Translate("Show AviSynth script");
            check_ffms_cache_in_temp.Content = Languages.Translate("Create FFmpegSource2 cache in Temp folder");
            check_delete_ff_cache.Content = Languages.Translate("Auto delete FFmpegSource2 cache");
            check_delete_lsmash_cache.Content = Languages.Translate("Auto delete LWLibav cache");
            check_delete_dgindex_cache.Content = Languages.Translate("Auto delete DGIndex cache");
            check_search_temp.Content = Languages.Translate("Search the best temp folder place on program start");
            check_auto_colormatrix.Content = Languages.Translate("Auto apply ColorMatrix for MPEG2 files");
            label_temppath.Content = Languages.Translate("Temp folder path:");
            button_temppath.ToolTip = Languages.Translate("Edit path");
            button_temppath_open.ToolTip = Languages.Translate("Open folder");
            check_window_size.Content = Languages.Translate("Restore the size and location of the main window");
            check_window_pos.Content = Languages.Translate("Fit windows to the working area bounds");
            check_hide_comments.Content = Languages.Translate("Remove comments (#text) from the AviSynth script");
            check_show_ftooltips.Content = Languages.Translate("Show advanced tooltips for filtering presets");
            check_resize_first.Content = Languages.Translate("Make crop/resize before filtering (otherwise - after filtering)");
            check_read_prmtrs.Content = Languages.Translate("Read parameters from the script when saving a new task");
            check_log_to_file.Content = Languages.Translate("Write encoding log to file");
            check_logfile_tempfolder.Content = Languages.Translate("in Temp folder");
            label_extensions.Content = Languages.Translate("Only files with this extensions will be opened:");
            check_batch_autoencoding.Content = Languages.Translate("Start encoding after opening all files");
            check_is_always_close_encoding.Content = Languages.Translate("Autoclose encoding window if task was successfully accomplished");
            check_dgindex_cache_in_temp.Content = Languages.Translate("Create DGIndex cache in Temp folder");
            label_clone.Content = Languages.Translate("Clone from the already opened file to each other:");
            check_clone_ar.Content = Languages.Translate("Aspect/Resolution info (crop, aspect, etc)");
            check_clone_trim.Content = Languages.Translate("Trim");
            check_clone_deint.Content = Languages.Translate("Deinterlace");
            check_clone_fps.Content = Languages.Translate("Framerate");
            check_clone_audio.Content = Languages.Translate("Audio options");
            check_batch_pause.Content = Languages.Translate("Make a pause after 1-st opened file");

            if (SysInfo.GetOSArchInt() == 64)
            {
                check_use_avs4x264.Content = Languages.Translate("Use 64-bit x264");
                check_use_avs4x264.ToolTip = Languages.Translate("This option will allow you to use 64-bit x264 with 32-bit AviSynth (via avs4x264 proxy)");
            }
            else
            {
                check_use_avs4x264.Content = Languages.Translate("Run x264 using avs4x264 proxy");
                check_use_avs4x264.ToolTip = Languages.Translate("Use this option if you run out of memory due to 32-bit OS limitation of ~2GB per process");
            }

            check_dont_delete_caches.Content = Languages.Translate("Don`t delete any caches and temporal files");
            check_use_trayicon.Content = Languages.Translate("Enable system tray icon");
            check_audio_first.Content = Languages.Translate("Encode audio first, then video");

            check_batch_pause.ToolTip = Languages.Translate("So you can tune all encoding settings as needed, and then continue opening");
            check_clone_ar.ToolTip = Languages.Translate("Clone: resolution, crop on each side, added black borders, output SAR/aspect and aspect adjusting method.") +
                "\r\n" + Languages.Translate("Note: Autocrop analysis will not be performed!");
            check_clone_trim.ToolTip = Languages.Translate("Clone: trim start and trim end (for each region)");
            check_clone_deint.ToolTip = Languages.Translate("Clone: source type, field order, deinterlace method.") +
                "\r\n" + Languages.Translate("Note: Autodeinterlace analysis will not be performed!");
            check_clone_fps.ToolTip = Languages.Translate("Clone: output framerate");
            check_clone_audio.ToolTip = Languages.Translate("Clone: output samplerate, samplerate converter, channels, channels converter");
            check_dont_delete_caches.ToolTip = Languages.Translate("Enable this option only if you use XviD4PSP as script creator, and then encoding it in another application.") +
                "\r\n" + Languages.Translate("Or for experiments. In any other cases this option must be disabled (unchecked)!");
            check_read_prmtrs.ToolTip = Languages.Translate("Read from the script: width, height, fps, duration and frames count.") + "\r\n" +
                Languages.Translate("Use it only if these parameters was changed manually in the script!");
            check_use_win7taskbar.Content = Languages.Translate("Enable Windows 7 taskbar progress indication");
            check_enable_backup.Content = Languages.Translate("Create a backups of the tasks list");
            check_validate_pathes.Content = Languages.Translate("Check for illegal characters in pathes");
            check_sort_by_time.Content = Languages.Translate("Sort presets by last modification time");
            check_auto_abort.Content = Languages.Translate("Cancel encoding if there is no progress for a long time");

            button_restore_hotkeys.Content = Languages.Translate("Restore default settings");
            button_edit_hotkeys.Content = Languages.Translate("Edit");
            button_save_hotkeys.Content = Languages.Translate("Save");
            label_action.Content = Languages.Translate("Action") + ":";
            label_combination.Content = Languages.Translate("Combination") + ":";

            tab_main.Header = Languages.Translate("Misc");
            tab_encoding.Header = Languages.Translate("Encoding");
            tab_temp.Header = Languages.Translate("Temp files");
            tab_open_folder.Header = Languages.Translate("Batch encoding");
            //tab_hotkeys.Header = Languages.Translate("HotKeys");

            check_x264_psnr.IsChecked = Settings.x264_PSNR;
            check_x264_ssim.IsChecked = Settings.x264_SSIM;
            check_x262_psnr.IsChecked = Settings.x262_PSNR;
            check_x262_ssim.IsChecked = Settings.x262_SSIM;
            check_show_arguments.IsChecked = Settings.ArgumentsToLog;
            check_show_script.IsChecked = Settings.PrintAviSynth;
            check_delete_ff_cache.IsChecked = Settings.DeleteFFCache;
            check_delete_lsmash_cache.IsChecked = Settings.DeleteLSMASHCache;
            check_delete_dgindex_cache.IsChecked = Settings.DeleteDGIndexCache;
            check_search_temp.IsChecked = Settings.SearchTempPath;
            textbox_temp.Text = Settings.TempPath;
            check_auto_colormatrix.IsChecked = Settings.AutoColorMatrix;
            check_window_size.IsChecked = Settings.WindowResize;                                  //Восстанавливать параметры главного окна
            check_hide_comments.IsChecked = Settings.HideComments;                                //Удалять комментарии из скрипта
            check_show_ftooltips.IsChecked = Settings.ShowFToolTips;                              //Показывать подсказки к пресетам фильтрации
            check_resize_first.IsChecked = Settings.ResizeFirst;                                  //Ресайз перед фильтрацией
            check_read_prmtrs.IsChecked = Settings.ReadScript;                                    //Считывать параметры скрипта
            check_log_to_file.IsChecked = Settings.WriteLog;                                      //Записывать лог кодирования в файл..
            check_logfile_tempfolder.IsChecked = Settings.LogInTemp;                              //.. а файл поместить во временную папку
            textbox_extensions.Text = Settings.GoodFilesExtensions;                               //Окно со списком допустимых расширений файлов (при пакетной обработке)
            check_batch_autoencoding.IsChecked = Settings.AutoBatchEncoding;                      //Автозапуск кодирования (при пакетной обработке)
            check_dgindex_cache_in_temp.IsChecked = Settings.DGIndexInTemp;                       //Помещать DGIndex-кэш в Темп-папку
            check_ffms_cache_in_temp.IsChecked = Settings.FFMS_IndexInTemp;                       //Помещать FFMS2-кэш в Темп-папку
            check_clone_ar.IsChecked = Settings.BatchCloneAR;                                     //Наследовать параметры Разрешения\Аспекта от предыдущего файла (при пакетной обработке)
            check_clone_trim.IsChecked = Settings.BatchCloneTrim;                                 //То-же что и выше, но для обрезки
            check_clone_deint.IsChecked = Settings.BatchCloneDeint;                               //А это для деинтерлейса
            check_clone_fps.IsChecked = Settings.BatchCloneFPS;                                   //Это для fps
            check_clone_audio.IsChecked = Settings.BatchCloneAudio;                               //Ну а это для звуковых параметров
            check_batch_pause.IsChecked = Settings.BatchPause;                                    //Пауза после первого открытого файла (чтоб выставить настройки и т.д.)
            check_use_avs4x264.IsChecked = Settings.UseAVS4x264;                                  //Запускать x264\x264_64 через avs4x264
            check_is_always_close_encoding.IsChecked = Settings.AutoClose;                        //Автозакрытие окна кодирования
            check_dont_delete_caches.IsChecked = !(check_delete_ff_cache.IsEnabled =
                 check_delete_lsmash_cache.IsEnabled =
                 check_delete_dgindex_cache.IsEnabled = Settings.DeleteTempFiles);                //Удалять кэши и временные файлы
            check_use_trayicon.IsChecked = Settings.TrayIconIsEnabled;                            //Иконка в трее вкл\выкл
            check_audio_first.IsChecked = Settings.EncodeAudioFirst;                              //Кодировать сначала звук, потом видео
            check_use_win7taskbar.IsChecked = Settings.Win7TaskbarIsEnabled;                      //Поддержка таскбара в Win7 вкл\выкл
            check_enable_backup.IsChecked = Settings.EnableBackup;                                //Разрешаем сохранять резервную копию списка заданий
            check_validate_pathes.IsChecked = Settings.ValidatePathes;                            //Проверять пути на "нехорошие" символы
            check_sort_by_time.IsChecked = Settings.SortPresetsByTime;                            //Сортировка пресетов по времени изменений
            check_auto_abort.IsChecked = Settings.AutoAbortEncoding;                              //Автоматически прерывать зависшие задания

            if ((bool)(check_window_pos.IsChecked = Settings.CheckWindowsPos))                    //Проверять размер и расположение окон
                this.SourceInitialized += new EventHandler(Window_SourceInitialized);

            //Загружаем HotKeys (плюс перевод к действиям)
            foreach (string line in HotKeys.Data)
            {
                if (line.Contains("="))
                {
                    string[] action_and_combination = line.Split(new string[] { "=" }, StringSplitOptions.None);
                    raw_action.Add(action_and_combination[0].Trim());
                    string translated_action = Languages.Translate(action_and_combination[0].Trim());
                    combo_action.Items.Add(translated_action);
                    listview_hotkeys.Items.Add(new { Column1 = translated_action, Column2 = action_and_combination[1] });
                }
            }
            combo_action.SelectedIndex = listview_hotkeys.SelectedIndex = 0;
            textbox_combination.Text = HotKeys.GetKeys(raw_action[combo_action.SelectedIndex].ToString());
            list_loaded = true;

            //Чтоб открыть окно на нужной вкладке
            if (set_focus_to == 2) tab_temp.IsSelected = true;
            else if (set_focus_to == 3) tab_encoding.IsSelected = true;
            else if (set_focus_to == 4) tab_open_folder.IsSelected = true;
            else if (set_focus_to == 5) tab_hotkeys.IsSelected = true;

            ShowDialog();
        }
Beispiel #18
0
        public XviD(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.num_bitrate.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_bitrate_ValueChanged);

            this.m = mass.Clone();
            this.p = parent;
            this.root_window = VideoEncWindow;

            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            //combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("3-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            combo_mode.Items.Add("3-Pass Size");

            //Прописываем Motion Search Precision
            combo_quality.Items.Add("0 - Disabled");
            combo_quality.Items.Add("1 - Very Low");
            combo_quality.Items.Add("2 - Low");
            combo_quality.Items.Add("3 - Medium");
            combo_quality.Items.Add("4 - High");
            combo_quality.Items.Add("5 - Very High");
            combo_quality.Items.Add("6 - Ultra High");

            combo_vhqmode.Items.Add("0 - Disabled");
            combo_vhqmode.Items.Add("1 - Mode Decision");
            combo_vhqmode.Items.Add("2 - Limited Search");
            combo_vhqmode.Items.Add("3 - Medium Search");
            combo_vhqmode.Items.Add("4 - Wide Search");

            combo_metric.Items.Add("0 - PSNR");
            combo_metric.Items.Add("1 - PSNR_HVSM");

            //прогружаем матрицы квантизации
            combo_qmatrix.Items.Add("H263");
            combo_qmatrix.Items.Add("MPEG");
            foreach (string matrix in PresetLoader.CustomMatrixes(MatrixTypes.CQM))
                combo_qmatrix.Items.Add(matrix);

            for (int i = 1; i < 32; i++)
            {
                combo_imin.Items.Add(i);
                combo_imax.Items.Add(i);
                combo_pmin.Items.Add(i);
                combo_pmax.Items.Add(i);
                combo_bmin.Items.Add(i);
                combo_bmax.Items.Add(i);
            }

            //прогружаем fourcc
            combo_fourcc.Items.Add("XVID");
            combo_fourcc.Items.Add("FFDS");
            combo_fourcc.Items.Add("FVFW");
            combo_fourcc.Items.Add("DX50");
            combo_fourcc.Items.Add("DIVX");
            combo_fourcc.Items.Add("MP4V");

            combo_masking.Items.Add("None");
            combo_masking.Items.Add("Lumi");
            combo_masking.Items.Add("Variance");

            //B фреймы
            for (int n = 0; n <= 4; n++) combo_bframes.Items.Add(n);

            combo_threads.Items.Add("Auto");
            for (int i = 1; i < 13; i++) combo_threads.Items.Add(i);

            //пресеты настроек и качества
            foreach (string preset in Enum.GetNames(typeof(CodecPresets)))
                combo_codec_preset.Items.Add(preset);

            text_mode.Content = Languages.Translate("Encoding mode") + ":";
            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            xvid_help.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            xvid_help.ToolTip = "Show xvid_encraw.exe -help screen";

            LoadFromProfile();
        }
Beispiel #19
0
        public Interlace(Massive mass, MainWindow parent)
        {
            this.InitializeComponent();

            if (mass != null)
            {
                m = mass.Clone();
                oldm = mass.Clone();
            }

            p = parent;
            Owner = p;

            //переводим
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            button_refresh.Content = Languages.Translate("Apply");
            button_refresh.ToolTip = Languages.Translate("Refresh preview");
            Title = Languages.Translate("Interlace") + "/" + Languages.Translate("Framerate");
            button_analyse.Content = Languages.Translate("Analyse");
            label_deinterlace.Content = Languages.Translate("Deinterlace") + ":";
            label_field_order.Content = Languages.Translate("Field order") + ":";
            label_source_info.Content = Languages.Translate("Detect source type") + ":";
            label_source_type.Content = Languages.Translate("Source type") + ":";
            label_outinterlace.Content = Languages.Translate("Target type") + ":";
            text_in_framerate.Content = Languages.Translate("Input framerate:");
            text_out_framerate.Content = Languages.Translate("Output framerate:");
            text_framerateconvertor.Content = Languages.Translate("Framerate converter:");
            if (m != null) text_in_framerate_value.Content = m.inframerate + " fps";
            //button_fullscreen.Content = Languages.Translate("Fullscreen");
            tab_main.Header = Languages.Translate("Main");
            tab_settings.Header = Languages.Translate("Settings");
            group_detector.Header = Languages.Translate("Source detector");
            group_misc.Header = Languages.Translate("Misc");
            text_analyze_percent.Content = Languages.Translate("Analyze (% of the source lenght)") + ":";
            text_min_sections.Content = Languages.Translate("But no less than (sections)") + ":";
            text_hybrid_int.Content = Languages.Translate("Hybrid interlace threshold") + " (%):";
            text_hybrid_fo.Content = Languages.Translate("Hybrid field order threshold") + " (%):";
            text_fo_portions.Content = Languages.Translate("Enable selective field order analysis");
            check_original_fps.Content = Languages.Translate("Use the original fps of the stream (if available)");
            check_nonstandard_fps.Content = Languages.Translate("Allow non-standard fps on output");

            if (m != null)
            {
                //забиваем
                foreach (string stype in Enum.GetNames(typeof(SourceType)))
                {
                    if (stype != "NOT_ENOUGH_SECTIONS")
                        combo_sourcetype.Items.Add(GetFixedSTypeString(stype));
                }
                combo_sourcetype.SelectedItem = GetFixedSTypeString(m.interlace.ToString());

                foreach (string fieldt in Enum.GetNames(typeof(FieldOrder)))
                    combo_fieldorder.Items.Add(GetFixedFieldString(fieldt));
                combo_fieldorder.SelectedItem = GetFixedFieldString(m.fieldOrder.ToString());

                //Деинтерлейс и всплывающие подсказки к нему
                foreach (DeinterlaceType dtype in Enum.GetValues(typeof(DeinterlaceType)))
                {
                    ComboBoxItem item = new ComboBoxItem();
                    string cont = dtype.ToString(), tltp = "";
                    double frate = Calculate.ConvertStringToDouble(m.inframerate);

                    string regular = Languages.Translate("Regular deinterlacing using");
                    string doubling = Languages.Translate("Deinterlacing with doubling frame rate using");
                    string telecine = Languages.Translate("Inverse Telecine (remove 3:2 pulldown) using");
                    string decimate1 = Languages.Translate("Auto searching and removing duplicate frames, so frame rate will be reduced to");
                    string decimate2 = Languages.Translate("it must be the original frame rate of the video BEFORE duplicates was added!");

                    if (dtype == DeinterlaceType.TFM) tltp = Languages.Translate("FieldMatching (for videos with ShiftedFields) using TFM");
                    else if (dtype == DeinterlaceType.Yadif) tltp = regular + " Yadif";
                    else if (dtype == DeinterlaceType.YadifModEDI) tltp = regular + " YadifMod+NNEDI2 (slow)";
                    else if (dtype == DeinterlaceType.TDeint) tltp = regular + " TDeint";
                    else if (dtype == DeinterlaceType.TDeintEDI) tltp = regular + " TDeint+EEDI2 (very slow)";
                    else if (dtype == DeinterlaceType.TomsMoComp) tltp = regular + " TomsMoComp";
                    else if (dtype == DeinterlaceType.LeakKernelDeint) tltp = regular + " LeakKernelDeint";
                    else if (dtype == DeinterlaceType.FieldDeinterlace) tltp = regular + " FieldDeinterlace (blending)";
                    else if (dtype == DeinterlaceType.QTGMC) { tltp = Languages.Translate("Deinterlacing with denoising using QTGMC (see Settings)"); }
                    else if (dtype == DeinterlaceType.QTGMC_2) { cont = "QTGMC (x2)"; tltp = Languages.Translate("Deinterlacing with doubling frame rate and denoising using QTGMC (see Settings)"); }
                    else if (dtype == DeinterlaceType.MCBob) { cont = "MCBob (x2)"; tltp = doubling + " MCBob (very slow)"; }
                    else if (dtype == DeinterlaceType.NNEDI) { cont = "NNEDI (x2)"; tltp = doubling + " NNEDI2"; }
                    else if (dtype == DeinterlaceType.YadifModEDI2) { cont = "YadifModEDI (x2)"; tltp = doubling + " YadifMod+NNEDI2"; }
                    else if (dtype == DeinterlaceType.SmoothDeinterlace) { cont = "SmoothDeinterlace (x2)"; tltp = doubling + " SmoothDeinterlace"; }
                    else if (dtype == DeinterlaceType.TIVTC) tltp = telecine + " TIVTC\r\n29.970->23.976";
                    else if (dtype == DeinterlaceType.TIVTC_TDeintEDI) { cont = "TIVTC+TDeintEDI"; tltp = telecine + " TIVTC+TDeint+NNEDI2\r\n29.970->23.976"; }
                    else if (dtype == DeinterlaceType.TIVTC_YadifModEDI) { cont = "TIVTC+YadifModEDI"; tltp = telecine + " TIVTC+YadifMod+NNEDI2\r\n29.970->23.976"; }
                    else if (dtype == DeinterlaceType.TDecimate) { cont = "TDecimate 1-in-5"; tltp = Languages.Translate("Remove duplicate frames (remove 1 frame from every 5 frames) using TDecimate") + "\r\n29.970->23.976"; }
                    else if (dtype == DeinterlaceType.TDecimate_23)
                    {
                        cont = "TDecimate to 23.976"; tltp = decimate1 + " 23.976.\r\n23.976 - " + decimate2;
                        item.IsEnabled = (frate > 23.976);
                    }
                    else if (dtype == DeinterlaceType.TDecimate_24)
                    {
                        cont = "TDecimate to 24.000"; tltp = decimate1 + " 24.000.\r\n24.000 - " + decimate2;
                        item.IsEnabled = (frate > 24.000);
                    }
                    else if (dtype == DeinterlaceType.TDecimate_25)
                    {
                        cont = "TDecimate to 25.000"; tltp = decimate1 + " 25.000.\r\n25.000 - " + decimate2;
                        item.IsEnabled = (frate > 25.000);
                    }
                    else tltp = null;

                    item.Tag = dtype;
                    item.Content = cont;
                    item.ToolTip = tltp;
                    combo_deinterlace.Items.Add(item);
                }
                combo_deinterlace.SelectedValue = m.deinterlace;

                bool any = false, infr = false, outfr = false;
                foreach (string f in Format.GetValidFrameratesList(m))
                {
                    if (f != "0.000")
                    {
                        if (!infr && f == m.inframerate) infr = true;
                        if (!outfr && f == m.outframerate) outfr = true;
                        combo_framerate.Items.Add(f + " fps");
                    }
                    else
                        any = true;
                }
                if (any) combo_framerate.Items.Insert(0, ""); else check_nonstandard_fps.IsEnabled = false;
                if (!infr && any && m.inframerate != m.outframerate) combo_framerate.Items.Add(m.inframerate + " fps");
                if (!outfr) combo_framerate.Items.Add(m.outframerate + " fps");
                combo_framerate.SelectedItem = m.outframerate + " fps";

                //интерлейс режимы
                foreach (string interlace in Enum.GetNames(typeof(Massive.InterlaceModes)))
                    combo_outinterlace.Items.Add(interlace);
                combo_outinterlace.SelectedItem = Format.GetCodecOutInterlace(m);

                foreach (AviSynthScripting.FramerateModifers ratechangers in Enum.GetValues(typeof(AviSynthScripting.FramerateModifers)))
                    combo_framerateconvertor.Items.Add(new ComboBoxItem() { Content = ratechangers });
                combo_framerateconvertor.SelectedValue = m.frameratemodifer;
                CheckFramerateModifierIsApplied();
            }
            else
            {
                tab_main.IsEnabled = false;
                tab_settings.IsSelected = true;
            }

            //Настройки
            num_analyze_percent.Value = (decimal)Settings.SD_Analyze;
            num_min_sections.Value = (decimal)Settings.SD_Min_Sections;
            num_hybrid_int.Value = (decimal)Settings.SD_Hybrid_Int;
            num_hybrid_fo.Value = (decimal)Settings.SD_Hybrid_FO;
            check_fo_portions.IsChecked = Settings.SD_Portions_FO;

            check_iscombed_mark.IsChecked = Settings.IsCombed_Mark;
            num_iscombed_cthresh.Value = Settings.IsCombed_CThresh;
            num_iscombed_mi.Value = Settings.IsCombed_MI;

            combo_qtgmc_preset.Items.Add("Draft");
            combo_qtgmc_preset.Items.Add("Ultra Fast");
            combo_qtgmc_preset.Items.Add("Super Fast");
            combo_qtgmc_preset.Items.Add("Very Fast");
            combo_qtgmc_preset.Items.Add("Faster");
            combo_qtgmc_preset.Items.Add("Fast");
            combo_qtgmc_preset.Items.Add("Medium");
            combo_qtgmc_preset.Items.Add("Slow");
            combo_qtgmc_preset.Items.Add("Slower");
            combo_qtgmc_preset.Items.Add("Very Slow");
            combo_qtgmc_preset.Items.Add("Placebo");
            combo_qtgmc_preset.SelectedItem = Settings.QTGMC_Preset;

            num_qtgmc_sharp.Value = (decimal)Settings.QTGMC_Sharpness;

            check_original_fps.IsChecked = Settings.MI_Original_fps;
            check_nonstandard_fps.IsChecked = Settings.Nonstandard_fps;

            SetTooltips();
            ShowDialog();
        }
Beispiel #20
0
        public FFRebuilder(MainWindow owner)
        {
            this.InitializeComponent();
            this.Owner = owner;
            this.p = owner;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //переводим
            button_cancel.Content = Languages.Translate("Cancel");
            button_start.Content = Languages.Translate("Start");
            tab_main.Header = Languages.Translate("Main");
            tab_log.Header = Languages.Translate("Log");
            tab_help.Header = Languages.Translate("Help");
            label_infile.Content = Languages.Translate("Input file path:");
            label_outfile.Content = Languages.Translate("Output file path:");
            group_options.Header = Languages.Translate("Options");
            group_files.Header = Languages.Translate("Files");
            group_info.Header = Languages.Translate("Info");
            label_acodec.Content = Languages.Translate("Audio codec") + ":";
            label_vcodec.Content = Languages.Translate("Video codec") + ":";
            label_format.Content = Languages.Translate("Format") + ":";
            button_play.Content = Languages.Translate("Play");
            button_add_profile.ToolTip = Languages.Translate("Add profile");
            button_remove_profile.ToolTip = Languages.Translate("Remove profile");
            button_store_profile.ToolTip = Languages.Translate("Save changes");
            textbox_search.Text = (button_search.Content = Languages.Translate("Search")) + "...";
            button_open.ToolTip = Languages.Translate("Open");
            button_save.ToolTip = Languages.Translate("Save");
            progress.Maximum = 100;

            //Format
            //Enum formats используется только для заполнения комбобокса, т.к. пользователь
            //может добавить свои форматы, но Enum уже никак не изменить.
            //combo_format.ToolTip = Languages.Translate("Format");
            combo_format.Items.Add("");
            foreach (string _format in Enum.GetNames(typeof(formats)))
                combo_format.Items.Add(_format);

            //Vcodec
            foreach (vcodecs _vcodec in Enum.GetValues(typeof(vcodecs)))
                combo_vcodec.Items.Add(_vcodec);

            //Colorspace
            combo_colorspace.ToolTip = "Color space";
            foreach (colorspace _color in Enum.GetValues(typeof(colorspace)))
                combo_colorspace.Items.Add(_color);

            //AR
            combo_aspect.ToolTip = Languages.Translate("Aspect");
            combo_aspect.Items.Add("AUTO");
            combo_aspect.Items.Add("1:1");
            combo_aspect.Items.Add("4:3");
            combo_aspect.Items.Add("1.66");
            combo_aspect.Items.Add("16:9");
            combo_aspect.Items.Add("1.85");
            combo_aspect.Items.Add("2.00");
            combo_aspect.Items.Add("2.21");
            combo_aspect.Items.Add("2.35");

            //FPS
            combo_framerate.ToolTip = Languages.Translate("Framerate");
            combo_framerate.Items.Add("AUTO");
            combo_framerate.Items.Add("15.000");
            combo_framerate.Items.Add("18.000");
            combo_framerate.Items.Add("20.000");
            combo_framerate.Items.Add("23.976");
            combo_framerate.Items.Add("23.980");
            combo_framerate.Items.Add("24.000");
            combo_framerate.Items.Add("25.000");
            combo_framerate.Items.Add("29.970");
            combo_framerate.Items.Add("30.000");
            combo_framerate.Items.Add("50.000");
            combo_framerate.Items.Add("59.940");
            combo_framerate.Items.Add("60.000");

            //Acodec
            foreach (acodecs _acodec in Enum.GetValues(typeof(acodecs)))
                combo_acodec.Items.Add(_acodec);

            //PCM Bits
            combo_bits.Items.Add("S8");
            combo_bits.Items.Add("S16BE");
            combo_bits.Items.Add("S16LE");
            combo_bits.Items.Add("S24BE");
            combo_bits.Items.Add("S24LE");
            combo_bits.Items.Add("S32BE");
            combo_bits.Items.Add("S32LE");
            combo_bits.Items.Add("U8");
            combo_bits.Items.Add("U16BE");
            combo_bits.Items.Add("U16LE");
            combo_bits.Items.Add("U24BE");
            combo_bits.Items.Add("U24LE");
            combo_bits.Items.Add("U32BE");
            combo_bits.Items.Add("U32LE");

            //Аудио трек
            combo_atrack.Items.Add(new ComboBoxItem() { Content = "AUTO", ToolTip = Languages.Translate("Select audio track") });
            combo_atrack.SelectedIndex = 0;

            //Дискретизация
            combo_srate.ToolTip = Languages.Translate("Samplerate");
            combo_srate.Items.Add("AUTO");
            combo_srate.Items.Add("22050");
            combo_srate.Items.Add("32000");
            combo_srate.Items.Add("44100");
            combo_srate.Items.Add("48000");
            combo_srate.Items.Add("96000");

            //Кол-во каналов
            combo_channels.ToolTip = Languages.Translate("Channels");
            combo_channels.Items.Add("AUTO");
            combo_channels.Items.Add("1");
            combo_channels.Items.Add("2");
            combo_channels.Items.Add("3");
            combo_channels.Items.Add("4");
            combo_channels.Items.Add("5");
            combo_channels.Items.Add("6");
            combo_channels.Items.Add("7");
            combo_channels.Items.Add("8");

            //Help
            combo_help.Items.Add("-L");
            combo_help.Items.Add("-help");
            combo_help.Items.Add("-version");
            combo_help.Items.Add("-formats");
            combo_help.Items.Add("-codecs");
            combo_help.Items.Add("-filters");
            combo_help.SelectedIndex = 1;

            LoadAllProfiles(); //Список профилей
            LoadFromProfile(); //Настройки из профиля
            UpdateCombosIsEnabled();

            Show();
        }
Beispiel #21
0
        public x262(Massive mass, VideoEncoding VideoEncWindow, MainWindow parent)
        {
            this.InitializeComponent();

            this.m = mass.Clone();
            this.root_window = VideoEncWindow;
            this.p = parent;

            //Mode
            combo_mode.Items.Add("1-Pass Bitrate");
            combo_mode.Items.Add("2-Pass Bitrate");
            combo_mode.Items.Add("3-Pass Bitrate");
            combo_mode.Items.Add("Constant Quality");
            combo_mode.Items.Add("Constant Quantizer");
            combo_mode.Items.Add("2-Pass Quality");
            combo_mode.Items.Add("3-Pass Quality");
            combo_mode.Items.Add("2-Pass Size");
            combo_mode.Items.Add("3-Pass Size");

            //Profile
            combo_mpg_profile.Items.Add(new ComboBoxItem { Content = "Auto" });
            combo_mpg_profile.Items.Add("Simple Profile");
            combo_mpg_profile.Items.Add("Main Profile");
            combo_mpg_profile.Items.Add("High Profile");

            //Level
            combo_level.Items.Add("Unrestricted");
            combo_level.Items.Add("Low");
            combo_level.Items.Add("Main");
            combo_level.Items.Add("High");
            combo_level.Items.Add("High-1440");
            combo_level.Items.Add("HighP");

            //Tune
            combo_tune.Items.Add("None");
            combo_tune.Items.Add("Film");
            combo_tune.Items.Add("Animation");
            combo_tune.Items.Add("Grain");
            combo_tune.Items.Add("Still Image");
            combo_tune.Items.Add("PSNR");
            combo_tune.Items.Add("SSIM");
            combo_tune.Items.Add("Fast Decode");

            //Adaptive Quantization
            for (double n = 0.1; n <= 2.1; n += 0.1)
                combo_adapt_quant.Items.Add(Calculate.ConvertDoubleToPointString(n, 1));

            combo_adapt_quant_mode.Items.Add("None");
            combo_adapt_quant_mode.Items.Add("VAQ");
            combo_adapt_quant_mode.Items.Add("A-VAQ");

            //Прописываем subme
            combo_subme.Items.Add("0 - Fullpel only");
            combo_subme.Items.Add("1 - QPel SAD");
            combo_subme.Items.Add("2 - QPel SATD");
            combo_subme.Items.Add("3 - HPel on MB then QPel");
            combo_subme.Items.Add("4 - Always QPel");
            combo_subme.Items.Add("5 - QPel & Bidir ME");
            combo_subme.Items.Add("6 - RD on I/P frames");
            combo_subme.Items.Add("7 - RD on all frames");
            combo_subme.Items.Add("8 - RD refinement on I/P frames");
            combo_subme.Items.Add("9 - RD refinement on all frames");

            //прописываем me алгоритм
            combo_me.Items.Add("Diamond");
            combo_me.Items.Add("Hexagon");
            combo_me.Items.Add("Multi Hexagon");
            combo_me.Items.Add("Exhaustive");
            combo_me.Items.Add("SATD Exhaustive");

            //прописываем me range
            for (int n = 4; n <= 64; n++)
                combo_merange.Items.Add(n);

            //B фреймы
            for (int n = 0; n <= 16; n++)
                combo_bframes.Items.Add(n);

            //DC precision
            for (int n = 8; n <= 11; n++)
                combo_dc_precision.Items.Add(n);

            combo_open_gop.Items.Add("No");
            combo_open_gop.Items.Add("Yes");

            //Кол-во потоков для lookahead
            combo_lookahead_threads.Items.Add("Auto");
            for (int n = 1; n <= 10; n++)
                combo_lookahead_threads.Items.Add(Convert.ToString(n));

            //Кол-во потоков для x262-го
            combo_threads_count.Items.Add("Auto");
            combo_threads_count.Items.Add("1");
            combo_threads_count.Items.Add("1+1"); //+ --thread-input
            for (int n = 2; n <= 32; n++)
                combo_threads_count.Items.Add(Convert.ToString(n));

            //-b-adapt
            combo_badapt_mode.Items.Add("Disabled");
            combo_badapt_mode.Items.Add("Fast");
            combo_badapt_mode.Items.Add("Optimal");

            combo_range_in.Items.Add("Auto");
            combo_range_in.Items.Add("TV");
            combo_range_in.Items.Add("PC");

            combo_range_out.Items.Add("Auto");
            combo_range_out.Items.Add("TV");
            combo_range_out.Items.Add("PC");

            combo_colorprim.Items.Add("Undefined");
            combo_colorprim.Items.Add("bt709");
            combo_colorprim.Items.Add("bt470m");
            combo_colorprim.Items.Add("bt470bg");
            combo_colorprim.Items.Add("smpte170m");
            combo_colorprim.Items.Add("smpte240m");
            combo_colorprim.Items.Add("film");

            combo_transfer.Items.Add("Undefined");
            combo_transfer.Items.Add("bt709");
            combo_transfer.Items.Add("bt470m");
            combo_transfer.Items.Add("bt470bg");
            combo_transfer.Items.Add("linear");
            combo_transfer.Items.Add("log100");
            combo_transfer.Items.Add("log316");
            combo_transfer.Items.Add("smpte170m");
            combo_transfer.Items.Add("smpte240m");

            combo_colormatrix.Items.Add("Undefined");
            combo_colormatrix.Items.Add("bt709");
            combo_colormatrix.Items.Add("fcc");
            combo_colormatrix.Items.Add("bt470bg");
            combo_colormatrix.Items.Add("smpte170m");
            combo_colormatrix.Items.Add("smpte240m");
            combo_colormatrix.Items.Add("GBR");
            combo_colormatrix.Items.Add("YCgCo");

            combo_colorspace.Items.Add("I420");
            combo_colorspace.Items.Add("I422");

            text_mode.Content = Languages.Translate("Encoding mode") + ":";
            Apply_CLI.Content = Languages.Translate("Apply");
            Reset_CLI.Content = Languages.Translate("Reset");
            x262_help.Content = Languages.Translate("Help");
            Reset_CLI.ToolTip = "Reset to last good CLI";
            x262_help.ToolTip = "Show x262.exe --fullhelp screen";

            LoadFromProfile();
        }