Exemplo n.º 1
0
        /// <summary>
        /// Video EQ - Saturation (Method)
        /// <summary>
        public static String Video_EQ_Saturation_Filter()
        {
            double value = VM.FilterVideoView.FilterVideo_EQ_Saturation_Value;

            string saturation = string.Empty;

            if (value != 0)
            {
                // FFmpeg Range 0 to 3
                // FFmpeg Default 1
                // Slider -100 to 100
                // Slider Default 0
                // Limit to 2 decimal places

                //saturation = "saturation=" + VM.FilterVideoView.FilterVideo_EQ_Saturation.Value.ToString();

                try
                {
                    saturation = "saturation=" +
                                 Convert.ToString(
                        Math.Round(
                            MainWindow.NormalizeValue(
                                value,                                        // input
                                -100,                                         // input min
                                100,                                          // input max
                                0,                                            // normalize min
                                3,                                            // normalize max
                                1                                             // ffmpeg default
                                )

                            , 2                             // max decimal places
                            )
                        );
                }
                catch
                {
                    // Log Console Message /////////
                    Log.WriteAction = () =>
                    {
                        Log.logParagraph.Inlines.Add(new LineBreak());
                        Log.logParagraph.Inlines.Add(new Bold(new Run("Error: Could not set Saturation."))
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    };
                    Log.LogActions.Add(Log.WriteAction);
                }
            }

            return(saturation);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Video EQ - Contrast (Method)
        /// <summary>
        public static String Video_EQ_Contrast_Filter(MainWindow mainwindow)
        {
            double value = mainwindow.slFiltersVideo_EQ_Contrast.Value;

            string contrast = string.Empty;

            if (value != 0)
            {
                // FFmpeg Range -2 to 2
                // FFmpeg Default 1
                // Slider -100 to 100
                // Slider Default 0
                // Limit to 2 decimal places

                //contrast = "contrast=" + mainwindow.slFiltersVideo_EQ_Contrast.Value.ToString();

                try
                {
                    contrast = "contrast=" +
                               Convert.ToString(
                        Math.Round(
                            MainWindow.NormalizeValue(
                                value,                                     // input
                                -100,                                      // input min
                                100,                                       // input max
                                -2,                                        // normalize min
                                2,                                         // normalize max
                                1                                          // ffdefault
                                )

                            , 2                         // max decimal places
                            )
                        );
                }
                catch
                {
                    // Log Console Message /////////
                    Log.WriteAction = () =>
                    {
                        Log.logParagraph.Inlines.Add(new LineBreak());
                        Log.logParagraph.Inlines.Add(new Bold(new Run("Error: Could not set Contrast."))
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    };
                    Log.LogActions.Add(Log.WriteAction);
                }
            }

            return(contrast);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Extra Stereo (Method)
        /// <summary>
        public static void ExtraStereo_Filter()
        {
            // FFmpeg Range 0 to ??
            // FFmpeg Default 2.5
            // Slider -100 to 100
            // Slider Default 0
            // Limit to 2 decimal places

            double value = VM.FilterAudioView.FilterAudio_ExtraStereo_Value;

            string extrastereo = string.Empty;

            if (value != 0)
            {
                try
                {
                    extrastereo = "extrastereo=" +
                                  Convert.ToString(
                        Math.Round(
                            MainWindow.NormalizeValue(
                                value,                                       // input
                                -100,                                        // input min
                                100,                                         // input max
                                0,                                           // normalize min
                                10,                                          // normalize max
                                2.5                                          // ffmpeg default
                                )

                            , 3                             // max decimal places
                            )
                        );

                    // Add to Filters List
                    aFiltersList.Add(extrastereo);
                }
                catch
                {
                    // Log Console Message /////////
                    Log.WriteAction = () =>
                    {
                        Log.logParagraph.Inlines.Add(new LineBreak());
                        Log.logParagraph.Inlines.Add(new Bold(new Run("Error: Could not set Extra Stereo."))
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    };
                    Log.LogActions.Add(Log.WriteAction);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Video EQ - Brightness (Method)
        /// <summary>
        public static String Video_EQ_Brightness_Filter(MainWindow mainwindow)
        {
            double value = mainwindow.slFiltersVideo_EQ_Brightness.Value;

            string brightness = string.Empty;

            if (value != 0)
            {
                // FFmpeg Range -1 to 1
                // FFmpeg Default 0
                // Slider -100 to 100
                // Slider Default 0
                // Limit to 2 decimal places

                //brightness = "brightness=" + mainwindow.slFiltersVideo_EQ_Brightness.Value.ToString();

                try
                {
                    brightness = "brightness=" +
                                 Convert.ToString(
                        Math.Round(
                            MainWindow.NormalizeValue(
                                value,                                        // input
                                -100,                                         // input min
                                100,                                          // input max
                                -1,                                           // normalize min
                                1,                                            // normalize max
                                0                                             // ffmpeg default
                                )
                            , 2
                            )
                        );
                }
                catch
                {
                    // Log Console Message /////////
                    Log.WriteAction = () =>
                    {
                        Log.logParagraph.Inlines.Add(new LineBreak());
                        Log.logParagraph.Inlines.Add(new Bold(new Run("Error: Could not set Brightness."))
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    };
                    Log.LogActions.Add(Log.WriteAction);
                }
            }

            return(brightness);
        }
Exemplo n.º 5
0
        /// <summary>
        ///     Video EQ - Gamma (Method)
        /// <summary>
        public static String Video_EQ_Gamma_Filter(ViewModel vm)
        {
            double value = vm.FilterVideo_EQ_Gamma_Value;

            string gamma = string.Empty;

            if (value != 0)
            {
                // FFmpeg Range 0.1 to 10
                // FFmpeg Default 1
                // Slider -100 to 100
                // Slider Default 0
                // Limit to 2 decimal places

                //gamma = "gamma=" + vm.FilterVideo_EQ_Gamma.Value.ToString();
                try
                {
                    gamma = "gamma=" +
                            Convert.ToString(
                        Math.Round(
                            MainWindow.NormalizeValue(
                                value,                                       // input
                                -100,                                        // input min
                                100,                                         // input max
                                0.1,                                         // normalize min
                                10,                                          // normalize max
                                1                                            // ffmpeg default
                                )

                            , 2                             // max decimal places
                            )
                        );
                }
                catch
                {
                    // Log Console Message /////////
                    Log.WriteAction = () =>
                    {
                        Log.logParagraph.Inlines.Add(new LineBreak());
                        Log.logParagraph.Inlines.Add(new Bold(new Run("Error: Could not set Gamma."))
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    };
                    Log.LogActions.Add(Log.WriteAction);
                }
            }

            return(gamma);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Selective Color Class
        /// <summary>
        //public static List<FilterVideoSelectiveColor> SelectiveColorList { get; set; }
        //public partial class FilterVideoSelectiveColor
        //{
        //    public string SelectiveColorName { get; set; }
        //    public Color SelectiveColorPreview { get; set; }
        //    public string SelectiveColorPreviewStr { get { return SelectiveColorPreview.ToString(); } }
        //    public FilterVideoSelectiveColor(string name, Color color)
        //    {
        //        SelectiveColorName = name;
        //        SelectiveColorPreview = color;
        //    }
        //}

        /// <summary>
        /// Selective Color Normalize (Method)
        /// <summary>
        public static String SelectiveColor_Normalize(double value)
        {
            // FFmpeg Range -1 to 1
            // Slider -100 to 100
            // Limit to 2 decimal places

            string decimalValue = Convert.ToString(
                Math.Round(
                    MainWindow.NormalizeValue(
                        value,                                    // input
                        -100,                                     // input min
                        100,                                      // input max
                        -1,                                       // normalize min
                        1,                                        // normalize max
                        0                                         // ffmpeg default
                        )
                    , 2
                    )
                );

            return(decimalValue);
        }