public static Massive EncodeLine(Massive m) { //Определяем дефолты (с учетом --preset и --tune) x264_arguments defaults = new x264_arguments(m.x264options.preset, m.x264options.tune, m.x264options.profile); //обнуляем старые строки m.vpasses.Clear(); string line = ""; if (m.encodingmode == Settings.EncodingModes.OnePass || m.encodingmode == Settings.EncodingModes.TwoPass || m.encodingmode == Settings.EncodingModes.ThreePass) line += "--bitrate " + m.outvbitrate; else if (m.encodingmode == Settings.EncodingModes.TwoPassSize || m.encodingmode == Settings.EncodingModes.ThreePassSize) line += "--size " + m.outvbitrate; else if (m.encodingmode == Settings.EncodingModes.Quality || m.encodingmode == Settings.EncodingModes.TwoPassQuality || m.encodingmode == Settings.EncodingModes.ThreePassQuality) line += "--crf " + Calculate.ConvertDoubleToPointString((double)m.outvbitrate, 1); else if (m.encodingmode == Settings.EncodingModes.Quantizer) line += "--qp " + m.outvbitrate; //Пресет line += " --preset " + m.x264options.preset.ToString().ToLower(); if (m.x264options.tune != defaults.tune && !m.x264options.extra_cli.Contains("--tune ")) line += " --tune " + m.x264options.tune.ToString().ToLower(); if (m.x264options.profile != defaults.profile && !m.x264options.extra_cli.Contains("--profile ")) line += " --profile " + m.x264options.profile.ToString().ToLower(); if (m.x264options.level != defaults.level && !m.x264options.extra_cli.Contains("--level ")) line += " --level " + m.x264options.level; if (m.x264options.reference != defaults.reference && !m.x264options.extra_cli.Contains("--ref ")) line += " --ref " + m.x264options.reference; if (m.x264options.aqmode != defaults.aqmode && !m.x264options.extra_cli.Contains("--aq-mode ")) line += " --aq-mode " + m.x264options.aqmode; if (m.x264options.aqstrength != defaults.aqstrength && m.x264options.aqmode != 0 && !m.x264options.extra_cli.Contains("--aq-strength ")) line += " --aq-strength " + m.x264options.aqstrength; if (!m.x264options.cabac && defaults.cabac && !m.x264options.extra_cli.Contains("--no-cabac")) line += " --no-cabac"; if (!m.x264options.mixedrefs && defaults.mixedrefs && !m.x264options.extra_cli.Contains("--no-mixed-refs")) line += " --no-mixed-refs"; if (!m.x264options.deblocking && defaults.deblocking && !m.x264options.extra_cli.Contains("--no-deblock")) line += " --no-deblock"; if (m.x264options.deblocking && (m.x264options.deblocks != defaults.deblocks || m.x264options.deblockt != defaults.deblockt) && !m.x264options.extra_cli.Contains("--deblock ")) line += " --deblock " + m.x264options.deblocks + ":" + m.x264options.deblockt; if (m.x264options.merange != defaults.merange && !m.x264options.extra_cli.Contains("--merange ")) line += " --merange " + m.x264options.merange; if (m.x264options.no_chroma && !defaults.no_chroma && !m.x264options.extra_cli.Contains("--no-chroma-me")) line += " --no-chroma-me"; if (m.x264options.bframes != defaults.bframes && !m.x264options.extra_cli.Contains("--bframes ")) line += " --bframes " + m.x264options.bframes; if (m.x264options.direct != defaults.direct && !m.x264options.extra_cli.Contains("--direct ")) line += " --direct " + m.x264options.direct; if (m.x264options.b_adapt != defaults.b_adapt && !m.x264options.extra_cli.Contains("--b-adapt ")) line += " --b-adapt " + m.x264options.b_adapt; if (m.x264options.bpyramid != defaults.bpyramid && !m.x264options.extra_cli.Contains("--b-pyramid ")) { if (m.x264options.bpyramid == 0) line += " --b-pyramid none"; else if (m.x264options.bpyramid == 1) line += " --b-pyramid strict"; else line += " --b-pyramid normal"; } if (!m.x264options.weightb && defaults.weightb && !m.x264options.extra_cli.Contains("--no-weightb")) line += " --no-weightb"; if (m.x264options.weightp != defaults.weightp && !m.x264options.extra_cli.Contains("--weightp ")) line += " --weightp " + m.x264options.weightp; if (m.x264options.trellis != defaults.trellis && !m.x264options.extra_cli.Contains("--trellis ")) line += " --trellis " + m.x264options.trellis; if (m.x264options.no_fastpskip && !defaults.no_fastpskip && !m.x264options.extra_cli.Contains("--no-fast-pskip")) line += " --no-fast-pskip"; if (m.x264options.no_dctdecimate && !defaults.no_dctdecimate && !m.x264options.extra_cli.Contains("--no-dct-decimate")) line += " --no-dct-decimate"; if (m.x264options.custommatrix != defaults.custommatrix && !m.x264options.extra_cli.Contains("--cqm ")) line += " --cqm " + m.x264options.custommatrix; if (m.x264options.min_quant != defaults.min_quant && !m.x264options.extra_cli.Contains("--qpmin ")) line += " --qpmin " + m.x264options.min_quant; if (m.x264options.max_quant != defaults.max_quant && !m.x264options.extra_cli.Contains("--qpmax ")) line += " --qpmax " + m.x264options.max_quant; if (m.x264options.step_quant != defaults.step_quant && !m.x264options.extra_cli.Contains("--qpstep ")) line += " --qpstep " + m.x264options.step_quant; if (m.x264options.aud && !defaults.aud && !m.x264options.extra_cli.Contains("--aud")) line += " --aud"; if (m.x264options.nal_hrd != defaults.nal_hrd && !m.x264options.extra_cli.Contains("--nal-hrd ")) line += " --nal-hrd " + m.x264options.nal_hrd; if (m.x264options.pictiming && !defaults.pictiming && !m.x264options.extra_cli.Contains("--pictiming")) line += " --pictiming"; if (m.x264options.no_psy && !defaults.no_psy && !m.x264options.extra_cli.Contains("--no-psy")) line += " --no-psy"; if (!m.x264options.no_psy && (m.x264options.psyrdo != defaults.psyrdo || m.x264options.psytrellis != defaults.psytrellis) && !m.x264options.extra_cli.Contains("--psy-rd ")) line += " --psy-rd " + Calculate.ConvertDoubleToPointString((double)m.x264options.psyrdo, 2) + ":" + Calculate.ConvertDoubleToPointString((double)m.x264options.psytrellis, 2); if (m.x264options.threads != defaults.threads && !m.x264options.extra_cli.Contains("--threads ")) { if (m.x264options.threads == "1" && m.x264options.thread_input) line += " --threads 1 --thread-input"; else line += " --threads " + m.x264options.threads; } if (m.x264options.qcomp != defaults.qcomp && !m.x264options.extra_cli.Contains("--qcomp ")) line += " --qcomp " + Calculate.ConvertDoubleToPointString((double)m.x264options.qcomp, 2); if (m.x264options.vbv_maxrate != defaults.vbv_maxrate && !m.x264options.extra_cli.Contains("--vbv-maxrate ")) line += " --vbv-maxrate " + m.x264options.vbv_maxrate; if (m.x264options.vbv_bufsize != defaults.vbv_bufsize && !m.x264options.extra_cli.Contains("--vbv-bufsize ")) line += " --vbv-bufsize " + m.x264options.vbv_bufsize; if (m.x264options.vbv_init != defaults.vbv_init && !m.x264options.extra_cli.Contains("--vbv-init ")) line += " --vbv-init " + Calculate.ConvertDoubleToPointString((double)m.x264options.vbv_init, 2); if (m.x264options.qp_offset != defaults.qp_offset && !m.x264options.extra_cli.Contains("--chroma-qp-offset ")) line += " --chroma-qp-offset " + m.x264options.qp_offset; if (m.x264options.analyse != defaults.analyse && !m.x264options.extra_cli.Contains("--partitions ")) line += " --partitions " + m.x264options.analyse; if (!m.x264options.adaptivedct && defaults.adaptivedct && !m.x264options.extra_cli.Contains("--no-8x8dct")) line += " --no-8x8dct"; if (m.x264options.subme != defaults.subme && !m.x264options.extra_cli.Contains("--subme ")) line += " --subme " + m.x264options.subme; if (m.x264options.me != defaults.me && !m.x264options.extra_cli.Contains("--me ")) line += " --me " + m.x264options.me; if (m.x264options.slow_frstpass && !defaults.slow_frstpass && !m.x264options.extra_cli.Contains("--slow-firstpass")) line += " --slow-firstpass"; if (m.x264options.no_mbtree && !defaults.no_mbtree && !m.x264options.extra_cli.Contains("--no-mbtree")) line += " --no-mbtree"; if (!m.x264options.no_mbtree && m.x264options.lookahead != defaults.lookahead && !m.x264options.extra_cli.Contains("--rc-lookahead ")) line += " --rc-lookahead " + m.x264options.lookahead; if (m.x264options.lookahead_threads != defaults.lookahead_threads && !m.x264options.extra_cli.Contains("--lookahead-threads ")) line += " --lookahead-threads " + m.x264options.lookahead_threads; if (m.x264options.gop_min > 0 && m.x264options.gop_min != defaults.gop_min && !m.x264options.extra_cli.Contains("--min-keyint ")) line += " --min-keyint " + m.x264options.gop_min; if (m.x264options.gop_max != defaults.gop_max && !m.x264options.extra_cli.Contains("--keyint ")) line += " --keyint " + (m.x264options.gop_max > 0 ? m.x264options.gop_max.ToString() : "infinite"); if (m.x264options.ratio_ip != defaults.ratio_ip && !m.x264options.extra_cli.Contains("--ipratio ")) line += " --ipratio " + Calculate.ConvertDoubleToPointString((double)m.x264options.ratio_ip, 2); if (m.x264options.ratio_pb != defaults.ratio_pb && !m.x264options.extra_cli.Contains("--pbratio ")) line += " --pbratio " + Calculate.ConvertDoubleToPointString((double)m.x264options.ratio_pb, 2); if (m.x264options.open_gop && !defaults.open_gop && !m.x264options.extra_cli.Contains("--open-gop")) line += " --open-gop"; if (m.x264options.slices != defaults.slices && !m.x264options.extra_cli.Contains("--slices ")) line += " --slices " + m.x264options.slices; if (m.x264options.pic_struct && !defaults.pic_struct && !m.x264options.extra_cli.Contains("--pic-struct")) line += " --pic-struct"; if (m.x264options.fake_int && !defaults.fake_int && !m.x264options.extra_cli.Contains("--fake-interlaced")) line += " --fake-interlaced"; if (m.x264options.range_in != defaults.range_in && !m.x264options.extra_cli.Contains("--input-range ")) line += " --input-range " + m.x264options.range_in; if (m.x264options.range_out != defaults.range_out && !m.x264options.extra_cli.Contains("--range ")) line += " --range " + m.x264options.range_out; if (m.x264options.colorprim != defaults.colorprim && !m.x264options.extra_cli.Contains("--colorprim ")) line += " --colorprim " + ((m.x264options.colorprim == "Undefined") ? "undef" : m.x264options.colorprim); if (m.x264options.transfer != defaults.transfer && !m.x264options.extra_cli.Contains("--transfer ")) line += " --transfer " + ((m.x264options.transfer == "Undefined") ? "undef" : m.x264options.transfer); if (m.x264options.colormatrix != defaults.colormatrix && !m.x264options.extra_cli.Contains("--colormatrix ")) line += " --colormatrix " + ((m.x264options.colormatrix == "Undefined") ? "undef" : m.x264options.colormatrix); if (m.x264options.colorspace != defaults.colorspace && !m.x264options.extra_cli.Contains("--output-csp ")) line += " --output-csp " + m.x264options.colorspace.ToLower(); if (m.x264options.non_deterministic && !defaults.non_deterministic && !m.x264options.extra_cli.Contains("--non-deterministic")) line += " --non-deterministic"; if (m.x264options.bluray && !defaults.bluray && !m.x264options.extra_cli.Contains("--bluray-compat")) line += " --bluray-compat"; line += " --extra:"; if (m.x264options.extra_cli != defaults.extra_cli) line += " " + m.x264options.extra_cli; //удаляем пустоту в начале line = line.TrimStart(new char[] { ' ' }); //забиваем данные в массив if (m.encodingmode == Settings.EncodingModes.OnePass || m.encodingmode == Settings.EncodingModes.Quality || m.encodingmode == Settings.EncodingModes.Quantizer) m.vpasses.Add(line); else if (m.encodingmode == Settings.EncodingModes.TwoPassQuality) { m.vpasses.Add("--pass 1 " + line); m.vpasses.Add("--pass 2 " + line); } else if (m.encodingmode == Settings.EncodingModes.ThreePassQuality) { m.vpasses.Add("--pass 1 " + line); m.vpasses.Add("--pass 3 " + line); m.vpasses.Add("--pass 2 " + line); } else if (m.encodingmode == Settings.EncodingModes.TwoPass || m.encodingmode == Settings.EncodingModes.TwoPassSize) { m.vpasses.Add("--pass 1 " + line); m.vpasses.Add("--pass 2 " + line); } else if (m.encodingmode == Settings.EncodingModes.ThreePass || m.encodingmode == Settings.EncodingModes.ThreePassSize) { m.vpasses.Add("--pass 1 " + line); m.vpasses.Add("--pass 3 " + line); m.vpasses.Add("--pass 2 " + line); } return m; }
private void SetToolTips() { //Определяем дефолты (с учетом --preset и --tune) //x264_arguments def = new x264_arguments(m.x264options.preset, m.x264options.tune, m.x264options.profile); //Определяем дефолты без учета --preset и --tune, т.к. это именно дефолты самого энкодера x264_arguments def = new x264_arguments(Presets.Medium, Tunes.None, m.x264options.profile); CultureInfo cult_info = new CultureInfo("en-US"); if (m.encodingmode == Settings.EncodingModes.OnePass || m.encodingmode == Settings.EncodingModes.TwoPass || m.encodingmode == Settings.EncodingModes.ThreePass) num_bitrate.ToolTip = "Set bitrate (Default: Auto)"; else if (m.encodingmode == Settings.EncodingModes.TwoPassSize || m.encodingmode == Settings.EncodingModes.ThreePassSize) num_bitrate.ToolTip = "Set file size (Default: InFileSize)"; else if (m.encodingmode == Settings.EncodingModes.Quantizer) num_bitrate.ToolTip = "Set target quantizer (0 - " + ((m.x264options.profile == Profiles.High10) ? "81" : "69") + "). Lower - better quality but bigger filesize.\r\n(Default: 23)"; else num_bitrate.ToolTip = "Set target quality (" + ((m.x264options.profile == Profiles.High10) ? "-12" : "0") + " - 51). Lower - better quality but bigger filesize.\r\n(Default: 23)"; combo_mode.ToolTip = "Encoding mode"; check_lossless.ToolTip = "Lossless encoding mode. High 4:4:4 AVC profile only!"; combo_avc_profile.ToolTip = "Limit AVC profile (--profile, default: " + def.profile.ToString() + ")\r\n" + "Auto - don`t set the --profile key\r\nBaseline - forced --no-8x8dct --bframes 0 --no-cabac --weightp 0\r\nMain - forced --no-8x8dct\r\nHigh - no restrictions\r\n" + "High 10 - switching to 10-bit depth encoding!"; combo_level.ToolTip = "Specify level (--level, default: Unrestricted)"; combo_tune.ToolTip = "Tune the settings for a particular type of source or situation (--tune, default: " + def.tune.ToString() + ")"; check_p8x8.ToolTip = "Enables partitions to consider: p8x8 (and also p16x8, p8x16)"; check_p4x4.ToolTip = "Enables partitions to consider: p4x4 (and also p8x4, p4x8), requires p8x8"; check_b8x8.ToolTip = "Enables partitions to consider: b8x8 (and also b16x8, b8x16)"; check_i8x8.ToolTip = "Enables partitions to consider: i8x8, requires Adaptive DCT"; check_i4x4.ToolTip = "Enables partitions to consider: i4x4"; check_8x8dct.ToolTip = "Adaptive spatial transform size (--no-8x8dct if not checked)"; combo_dstrength.ToolTip = "Deblocking filter strength (--deblock, default: " + def.deblocks + ":0)"; combo_dthreshold.ToolTip = "Deblocking filter treshold (--deblock, default: 0:" + def.deblockt + ")"; check_deblocking.ToolTip = "Deblocking filter (default: enabled)"; combo_subme.ToolTip = "Subpixel motion estimation and mode decision (--subme, default: " + def.subme + ")\r\n" + "1 - fast\r\n7 - medium\r\n10 & 11 - slow, requires Trellis = 2 and AQ mode > 0"; combo_me.ToolTip = "Integer pixel motion estimation method (--me, default: --me " + def.me + ")\r\n" + "Diamond Search, fast (--me dia)\r\nHexagonal Search (--me hex)\r\nUneven Multi-Hexagon Search (--me umh)\r\n" + "Exhaustive Search (--me esa)\r\nSATD Exhaustive Search, slow (--me tesa)"; combo_merange.ToolTip = "Maximum motion vector search range (--merange, default: " + def.merange + ")"; check_chroma.ToolTip = "Ignore chroma in motion estimation (--no-chroma-me, default: unchecked)"; combo_bframes.ToolTip = "Number of B-frames between I and P (--bframes, default: " + def.bframes + ")"; combo_bframe_mode.ToolTip = "Direct MV prediction mode, requires B-frames (--direct, default: " + (def.direct.Substring(0, 1).ToUpper() + def.direct.Substring(1)) + ")"; combo_bpyramid_mode.ToolTip = "Keep some B-frames as references (--b-pyramid, default: " + (def.bpyramid == 0 ? "None)" : def.bpyramid == 1 ? "Strict)" : "Normal)") + "\r\nNone - disabled \r\nStrict - strictly hierarchical pyramid (Blu-ray compatible)\r\nNormal - non-strict (not Blu-ray compatible)"; check_weightedb.ToolTip = "Weighted prediction for B-frames (--no-weightb if not checked)"; combo_weightp_mode.ToolTip = "Weighted prediction for P-frames (--weightp, default: " + (def.weightp == 0 ? "Disabled)" : def.weightp == 1 ? "Blind offset)" : "Smart analysis)"); combo_trellis.ToolTip = "Trellis RD quantization (--trellis, default: " + def.trellis + ")\r\n" + "0 - disabled\r\n1 - enabled only on the final encode of a MB\r\n2 - enabled on all mode decisions"; combo_ref.ToolTip = "Number of reference frames (--ref, default: " + def.reference + ")"; check_mixed_ref.ToolTip = "Decide references on a per partition basis (--no-mixed-refs if not checked)"; check_cabac.ToolTip = "Enable CABAC (--no-cabac if not checked)"; check_fast_pskip.ToolTip = "Disables early SKIP detection on P-frames (--no-fast-pskip, default: unchecked)"; check_dct_decimate.ToolTip = "Disables coefficient thresholding on P-frames (--no-dct-decimate, default: unchecked)"; num_min_quant.ToolTip = "Set min QP (--qpmin, default: " + def.min_quant + ")"; num_max_quant.ToolTip = "Set max QP (--qpmax, default: " + def.max_quant + ")"; num_step_quant.ToolTip = "Set max QP step (--qpstep, default: " + def.step_quant + ")"; if (m.encodingmode == Settings.EncodingModes.Quality || m.encodingmode == Settings.EncodingModes.Quantizer || m.encodingmode == Settings.EncodingModes.TwoPassQuality || m.encodingmode == Settings.EncodingModes.ThreePassQuality) { slider_preset.ToolTip = "Set encoding preset (--preset, default: Medium):" + Environment.NewLine + "Ultrafast - fastest encoding, but biggest output file size" + Environment.NewLine + "Medium - default, good speed and medium file size" + Environment.NewLine + "Veryslow - high quality encoding, small file size" + Environment.NewLine + "Placebo - super high quality encoding, smallest file size"; } else { slider_preset.ToolTip = "Set encoding preset (--preset, default: Medium):" + Environment.NewLine + "Ultrafast - fastest encoding, bad quality" + Environment.NewLine + "Medium - default, optimal speed-quality solution" + Environment.NewLine + "Veryslow - high quality encoding" + Environment.NewLine + "Placebo - super high quality encoding"; } combo_badapt_mode.ToolTip = "Adaptive B-frame decision method (--b-adapt, default: " + (def.b_adapt == 0 ? "Disabled)" : def.b_adapt == 1 ? "Fast)" : "Optimal"); combo_adapt_quant_mode.ToolTip = "AQ mode (--aq-mode, default: " + (def.aqmode == 0 ? "None" : def.aqmode == 1 ? "VAQ" : "A-VAQ") + ")\r\n" + "None - disabled, 0\r\nVAQ - variance AQ (complexity mask), 1\r\nA-VAQ - auto-variance AQ (experimental), 2"; combo_adapt_quant.ToolTip = "AQ Strength (--ag-strength, default: " + def.aqstrength + ")\r\n" + "Reduces blocking and blurring in flat and textured areas: 0.5 - weak AQ, 1.5 - strong AQ"; num_psyrdo.ToolTip = "Strength of psychovisual RD optimization, requires Subpixel ME >= 6 (--psy-rd, default: " + def.psyrdo.ToString(cult_info) + ")"; num_psytrellis.ToolTip = "Strength of psychovisual Trellis optimization, requires Trellis >= 1 (--psy-rd, default: " + def.psytrellis.ToString(cult_info) + ")"; num_vbv_max.ToolTip = "Max local bitrate, kbit/s (--vbv-maxrate, default: " + def.vbv_maxrate + ")"; num_vbv_buf.ToolTip = "Set size of the VBV buffer, kbit (--vbv-bufsize, default: " + def.vbv_bufsize + ")"; num_vbv_init.ToolTip = "Initial VBV buffer occupancy (--vbv-init, default: " + def.vbv_init.ToString(cult_info) + ")"; num_qcomp.ToolTip = "QP curve compression (--qcomp, default: " + def.qcomp.ToString(cult_info) + ")\r\n0.00 => CBR, 1.00 => CQP"; num_chroma_qp.ToolTip = "QP difference between chroma and luma (--chroma-qp-offset, default: " + def.qp_offset + ")"; combo_threads_count.ToolTip = "Set number of threads for encoding (--threads, default: Auto)\r\n" + "Auto = 1.5 * logical_processors\r\n1+1 = --threads 1 --thread-input"; check_slow_first.ToolTip = "Enable slow 1-st pass for multipassing encoding (off by default)" + Environment.NewLine + "(--slow-firstpass if checked)"; check_nombtree.ToolTip = "Disable mb-tree ratecontrol (off by default, --no-mbtree if checked)"; num_lookahead.ToolTip = "Number of frames for mb-tree ratecontrol and VBV-lookahead (--rc-lookahead, default: " + def.lookahead + ")"; combo_lookahead_threads.ToolTip = "Force a specific number of lookahead threads (--lookahead-threads, default: Auto)\r\nAuto = 1/6 of regular threads."; check_enable_psy.ToolTip = "If unchecked disable all visual optimizations that worsen both PSNR and SSIM" + Environment.NewLine + "(--no-psy if not checked)"; num_min_gop.ToolTip = "Minimum GOP size (--min-keyint, default: " + def.gop_min + ")\r\n0 - Auto"; num_max_gop.ToolTip = "Maximum GOP size (--keyint, default: " + def.gop_max + ")\r\n0 - \"infinite\""; combo_nal_hrd.ToolTip = "Signal HRD information, requires VBV parameters (--nal-hrd, default: None)\r\nCBR not allowed in .mp4"; check_aud.ToolTip = "Use Access Unit Delimiters (--aud, default: unchecked)"; num_ratio_ip.ToolTip = "QP factor between I and P (--ipratio, default: " + def.ratio_ip.ToString(cult_info) + ")"; num_ratio_pb.ToolTip = "QP factor between P and B (--pbratio, default: " + def.ratio_pb.ToString(cult_info) + ")"; combo_open_gop.ToolTip = "Use recovery points to close GOPs, requires B-frames (--open-gop, default: " + (!def.open_gop ? "No" : "Yes") + ")"; num_slices.ToolTip = "Number of slices per frame (--slices, default: " + def.slices + ")"; check_pic_struct.ToolTip = "Force pic_struct in Picture Timing SEI (--pic-struct, default: unchecked)"; check_fake_int.ToolTip = "Flag stream as interlaced but encode progressive (--fake-interlaced, default: unchecked)"; combo_range_in.ToolTip = "Forces the range of the input (--input-range, default: Auto)\r\nIf input and output ranges aren't the same, x264 will perform range conversion!"; combo_range_out.ToolTip = "Sets the range of the output (--range, default: Auto)\r\nIf input and output ranges aren't the same, x264 will perform range conversion!"; combo_colorprim.ToolTip = "Specify color primaries (--colorprim, default: " + def.colorprim + ")"; combo_transfer.ToolTip = "Specify transfer characteristics (--transfer, default: " + def.transfer + ")"; combo_colormatrix.ToolTip = "Specify color matrix setting (--colormatrix, default: " + def.colormatrix + ")"; combo_colorspace.ToolTip = "Specify output colorspace (--output-csp, default: " + def.colorspace + ")\r\nDo not change it if you don't know what you`re doing!"; check_non_deterministic.ToolTip = "Slightly improve quality when encoding with --threads > 1, at the cost of non-deterministic output encodes\r\n(--non-deterministic, default: unchecked)"; check_bluray.ToolTip = "Enable compatibility hacks for Blu-ray support (--bluray-compat, default: unchecked)"; }
private void slider_preset_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { if (slider_preset.IsFocused || slider_preset.IsMouseOver) { //Создаем новые параметры с учетом --preset, и берем от них только те, от которых зависит пресет m.x264options.preset = (Presets)Enum.ToObject(typeof(Presets), (int)slider_preset.Value); x264_arguments defaults = new x264_arguments(m.x264options.preset, m.x264options.tune, m.x264options.profile); m.x264options.adaptivedct = defaults.adaptivedct; m.x264options.analyse = defaults.analyse; m.x264options.aqmode = defaults.aqmode; m.x264options.b_adapt = defaults.b_adapt; m.x264options.bframes = defaults.bframes; m.x264options.bpyramid = defaults.bpyramid; m.x264options.cabac = defaults.cabac; m.x264options.deblocking = defaults.deblocking; m.x264options.direct = defaults.direct;// m.x264options.lookahead = defaults.lookahead; m.x264options.me = defaults.me; m.x264options.merange = defaults.merange; m.x264options.mixedrefs = defaults.mixedrefs; m.x264options.no_fastpskip = defaults.no_fastpskip; m.x264options.no_mbtree = defaults.no_mbtree; m.x264options.psyrdo = defaults.psyrdo;// m.x264options.reference = defaults.reference; m.x264options.slow_frstpass = defaults.slow_frstpass; m.x264options.subme = defaults.subme; m.x264options.trellis = defaults.trellis; m.x264options.weightb = defaults.weightb; m.x264options.weightp = defaults.weightp; root_window.UpdateOutSize(); root_window.UpdateManualProfile(); m = DecodeLine(m); //Пересчитываем параметры из CLI в m.x264options (это нужно для "--extra:") LoadFromProfile(); //Выставляем значения из m.x264options в элементы управления } }
private void combo_tune_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (combo_tune.IsDropDownOpen || combo_tune.IsSelectionBoxHighlighted) { //Создаем новые параметры с учетом --tune, и берем от них только те, от которых зависит tune m.x264options.tune = (Tunes)Enum.ToObject(typeof(Tunes), combo_tune.SelectedIndex); x264_arguments defaults = new x264_arguments(m.x264options.preset, m.x264options.tune, m.x264options.profile); m.x264options.aqmode = defaults.aqmode; m.x264options.aqstrength = defaults.aqstrength; m.x264options.bframes = defaults.bframes; m.x264options.cabac = defaults.cabac; m.x264options.deblocking = defaults.deblocking; m.x264options.deblocks = defaults.deblocks; m.x264options.deblockt = defaults.deblockt; m.x264options.no_dctdecimate = defaults.no_dctdecimate; m.x264options.no_psy = defaults.no_psy; m.x264options.psyrdo = defaults.psyrdo; m.x264options.psytrellis = defaults.psytrellis; m.x264options.qcomp = defaults.qcomp; m.x264options.ratio_ip = defaults.ratio_ip; m.x264options.ratio_pb = defaults.ratio_pb; m.x264options.reference = defaults.reference; m.x264options.weightb = defaults.weightb; m.x264options.weightp = defaults.weightp; root_window.UpdateOutSize(); root_window.UpdateManualProfile(); m = DecodeLine(m); //Пересчитываем параметры из CLI в m.x264options (это нужно для "--extra:") LoadFromProfile(); //Выставляем значения из m.x264options в элементы управления } }