Пример #1
0
 private void LoadCodecWindow()
 {
     //загрузка
     if (m.outvcodec == "x264")
     {
         x264c = new x264(m, this, p);
         grid_codec.Children.Add(x264c);
     }
     else if (m.outvcodec == "x262")
     {
         x262c = new x262(m, this, p);
         grid_codec.Children.Add(x262c);
     }
     else if (m.outvcodec == "XviD")
     {
         xvid = new XviD(m, this, p);
         grid_codec.Children.Add(xvid);
     }
     else if (m.outvcodec == "MPEG1")
     {
         mpeg1 = new FMPEG1(m, this, p);
         grid_codec.Children.Add(mpeg1);
     }
     else if (m.outvcodec == "MPEG2")
     {
         mpeg2 = new FMPEG2(m, this, p);
         grid_codec.Children.Add(mpeg2);
     }
     else if (m.outvcodec == "MPEG4")
     {
         mpeg4 = new FMPEG4(m, this, p);
         grid_codec.Children.Add(mpeg4);
     }
     else if (m.outvcodec == "DV")
     {
         dv = new FDV(m, this, p);
         grid_codec.Children.Add(dv);
     }
     else if (m.outvcodec == "HUFF")
     {
         huff = new FFHUFF(m, this, p);
         grid_codec.Children.Add(huff);
     }
     else if (m.outvcodec == "FFV1")
     {
         ffv1 = new FFV1(m, this, p);
         grid_codec.Children.Add(ffv1);
     }
     else if (m.outvcodec == "FLV1")
     {
         flv = new FLV1(m, this, p);
         grid_codec.Children.Add(flv);
     }
     else if (m.outvcodec == "MJPEG")
     {
         mjpeg = new FMJPEG(m, this, p);
         grid_codec.Children.Add(mjpeg);
     }
     else if (m.outvcodec == "Copy")
     {
         copyordisabled = new CopyOrDisabled();
             copyordisabled.text_info.Content = "Codec: " + m.invcodecshort + Environment.NewLine;
             copyordisabled.text_info.Content += "Bitrate: " + m.invbitrate + " kbps" + Environment.NewLine;
             copyordisabled.text_info.Content += "Resolution: " + m.inresw + "x" + m.inresh + Environment.NewLine;
             copyordisabled.text_info.Content += "Framerate: " + m.inframerate + " fps";
         grid_codec.Children.Add(copyordisabled);
     }
 }
Пример #2
0
 private void UnLoadCodecWindow()
 {
     //очистка
     if (x264c != null)
     {
         grid_codec.Children.Remove(x264c);
         x264c = null;
     }
     else if (x262c != null)
     {
         grid_codec.Children.Remove(x262c);
         x262c = null;
     }
     else if (xvid != null)
     {
         grid_codec.Children.Remove(xvid);
         xvid = null;
     }
     else if (mpeg1 != null)
     {
         grid_codec.Children.Remove(mpeg1);
         mpeg1 = null;
     }
     else if (mpeg2 != null)
     {
         grid_codec.Children.Remove(mpeg2);
         mpeg2 = null;
     }
     else if (mpeg4 != null)
     {
         grid_codec.Children.Remove(mpeg4);
         mpeg4 = null;
     }
     else if (dv != null)
     {
         grid_codec.Children.Remove(dv);
         dv = null;
     }
     else if (huff != null)
     {
         grid_codec.Children.Remove(huff);
         huff = null;
     }
     else if (ffv1 != null)
     {
         grid_codec.Children.Remove(ffv1);
         ffv1 = null;
     }
     else if (flv != null)
     {
         grid_codec.Children.Remove(flv);
         flv = null;
     }
     else if (mjpeg != null)
     {
         grid_codec.Children.Remove(mjpeg);
         mjpeg = null;
     }
     else if (copyordisabled != null)
     {
         grid_codec.Children.Remove(copyordisabled);
         copyordisabled = null;
     }
 }
Пример #3
0
        public x264_arguments(x264.Presets preset, x264.Tunes tune, x264.Profiles profile)
        {
            //Выставляем значения в соответствии с пресетом
            if (preset == x264.Presets.Ultrafast)
            {
                _adaptivedct = false;
                _analyse = "none";
                _aqmode = 0;
                _b_adapt = 0;
                _bframes = 0;
                _bpyramid = 0;
                _cabac = false;
                _deblocking = false;
                _direct = "none";//
                _lookahead = 0;
                _me = "dia";
                _mixedrefs = false;
                _no_mbtree = true;
                _psyrdo = 0.0m;//
                _reference = 1;
                _subme = 0;
                _trellis = 0;
                _weightb = false;
                _weightp = 0;
                //--scenecut 0
            }
            else if (preset == x264.Presets.Superfast)
            {
                _analyse = "i8x8,i4x4";
                _lookahead = 0;
                _me = "dia";
                _mixedrefs = false;
                _no_mbtree = true;
                _reference = 1;
                _subme = 1;
                _trellis = 0;
                _weightp = 1;
            }
            else if (preset == x264.Presets.Veryfast)
            {
                _lookahead = 10;
                _mixedrefs = false;
                _reference = 1;
                _subme = 2;
                _trellis = 0;
                _weightp = 1;
            }
            else if (preset == x264.Presets.Faster)
            {
                _lookahead = 20;
                _mixedrefs = false;
                _reference = 2;
                _subme = 4;
                _weightp = 1;
            }
            else if (preset == x264.Presets.Fast)
            {
                _reference = 2;
                _subme = 6;
                _lookahead = 30;
                _weightp = 1;
            }
            else if (preset == x264.Presets.Medium)
            {
                //(defaults)
            }
            else if (preset == x264.Presets.Slow)
            {
                _b_adapt = 2;
                _direct = "auto";
                _lookahead = 50;
                _me = "umh";
                _reference = 5;
                _subme = 8;
            }
            else if (preset == x264.Presets.Slower)
            {
                _analyse = "all";
                _b_adapt = 2;
                _direct = "auto";
                _lookahead = 60;
                _me = "umh";
                _reference = 8;
                _subme = 9;
                _trellis = 2;
            }
            else if (preset == x264.Presets.Veryslow)
            {
                _analyse = "all";
                _b_adapt = 2;
                _bframes = 8;
                _direct = "auto";
                _lookahead = 60;
                _me = "umh";
                _merange = 24;
                _reference = 16;
                _subme = 10;
                _trellis = 2;
            }
            else if (preset == x264.Presets.Placebo)
            {
                _analyse = "all";
                _b_adapt = 2;
                _bframes = 16;
                _direct = "auto";
                _lookahead = 60;
                _me = "tesa";
                _merange = 24;
                _no_fastpskip = true;
                _reference = 16;
                _slow_frstpass = true;
                _subme = 11;
                _trellis = 2;
            }

            //Изменения под Tune
            if (tune == x264.Tunes.None)
            {
                //(defaults)
            }
            else if (tune == x264.Tunes.Film)
            {
                _deblocks = -1;
                _deblockt = -1;
                _psytrellis = 0.15m;
            }
            else if (tune == x264.Tunes.Animation)
            {
                _bframes += 2;
                _deblocks = 1;
                _deblockt = 1;
                _psyrdo = 0.4m;
                _aqstrength = "0.6";
                _reference = (_reference > 1) ? _reference * 2 : 1;
            }
            else if (tune == x264.Tunes.Grain)
            {
                _aqstrength = "0.5";
                _no_dctdecimate = true;
                _deblocks = -2;
                _deblockt = -2;
                _ratio_ip = 1.1m;
                _ratio_pb = 1.1m;
                _psytrellis = 0.25m;
                _qcomp = 0.8m;
            }
            else if (tune == x264.Tunes.StillImage)
            {
                _aqstrength = "1.2";
                _deblocks = -3;
                _deblockt = -3;
                _psyrdo = 2.0m;
                _psytrellis = 0.7m;
            }
            else if (tune == x264.Tunes.PSNR)
            {
                _aqmode = 0;
                _no_psy = true;
            }
            else if (tune == x264.Tunes.SSIM)
            {
                _aqmode = 2;
                _no_psy = true;
            }
            else if (tune == x264.Tunes.FastDecode)
            {
                _cabac = false;
                _deblocking = false;
                _weightb = false;
                _weightp = 0;
            }

            //Ограничения Profile
            /*if (profile == x264.Profiles.Baseline)
            {
                _adaptivedct = false;
                _bframes = 0;
                _cabac = false;
                _weightp = 0;
            }
            else if (profile == x264.Profiles.Main)
            {
                _adaptivedct = false;
            }
            else*/ if (profile == x264.Profiles.High10)
            {
                //10-bit depth
                _max_quant = 81;
            }
        }