Exemplo n.º 1
0
        /// <summary>
        ///    Window Loaded
        /// </summary>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ViewModel vm = mainwindow.DataContext as ViewModel;

            // -------------------------
            // Display FFprobe File Properties
            // -------------------------

            // Get FFprobe Path
            MainWindow.FFprobePath(vm);

            // -------------------------
            // Write Properties to Window
            // -------------------------
            try
            {
                Paragraph propertiesParagraph = new Paragraph(); //RichTextBox

                // Clear Rich Text Box on Start
                propertiesParagraph.Inlines.Clear();

                // Start
                rtbFileProperties.Document = new FlowDocument(propertiesParagraph);

                FFprobe.argsFileProperties = " -i" + " " + "\"" + vm.Input_Text + "\"" + " -v quiet -print_format ini -show_format -show_streams";

                FFprobe.inputFileProperties = FFprobe.InputFileInfo(vm.Input_Text,
                                                                    vm.Batch_IsChecked,
                                                                    FFprobe.argsFileProperties
                                                                    );

                // Write All File Properties to Rich Text Box
                if (!string.IsNullOrEmpty(FFprobe.inputFileProperties))
                {
                    rtbFileProperties.BeginChange(); // begin change

                    propertiesParagraph.Inlines.Add(new Run(FFprobe.inputFileProperties)
                    {
                        Foreground = Log.ConsoleDefault
                    });

                    rtbFileProperties.EndChange(); // end change
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///    Window Loaded
        /// </summary>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Display FFprobe File Properties

            Paragraph propertiesParagraph = new Paragraph();                         //RichTextBox

            this.rtbFileProperties.Document = new FlowDocument(propertiesParagraph); // start
            this.rtbFileProperties.BeginChange();                                    // begin change

            // Clear Rich Text Box on Start
            propertiesParagraph.Inlines.Clear();

            // Write All File Properties to Rich Text Box
            //propertiesParagraph.Inlines.Add(new Run(FFprobe.inputFileProperties) { Foreground = Log.ConsoleDefault });
            FFprobe.argsFileProperties  = " -i" + " " + "\"" + mainwindow.tbxInput.Text + "\"" + " -v quiet -print_format ini -show_format -show_streams";
            FFprobe.inputFileProperties = FFprobe.InputFileInfo(mainwindow, FFprobe.argsFileProperties);

            propertiesParagraph.Inlines.Add(new Run(FFprobe.inputFileProperties)
            {
                Foreground = Log.ConsoleDefault
            });

            this.rtbFileProperties.EndChange(); // end change
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Debug Test Button
        /// </summary>
        private void btnDebugTest_Click(object sender, RoutedEventArgs e)
        {
            // -------------------------
            // Keep FFmpeg Window Toggle
            // -------------------------
            //MainWindow.KeepWindow(mainwindow);

            // -------------------------
            // Batch Extention Period Check
            // -------------------------
            MainWindow.BatchExtCheck(mainwindow);

            // -------------------------
            // Set FFprobe Path
            // -------------------------
            MainWindow.FFprobePath(mainwindow);

            // -------------------------
            // Ready Halts
            // -------------------------
            MainWindow.ReadyHalts(mainwindow);


            // -------------------------
            // Background Thread Worker
            // -------------------------
            BackgroundWorker fileprocess = new BackgroundWorker();

            fileprocess.WorkerSupportsCancellation = true;
            fileprocess.WorkerReportsProgress      = true;

            fileprocess.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs args)
            {
                BackgroundWorker b = o as BackgroundWorker;

                // Cross-Thread Communication
                this.Dispatcher.Invoke(() =>
                {
                    // -------------------------
                    // Single
                    // -------------------------
                    if (mainwindow.tglBatch.IsChecked == false)
                    {
                        // -------------------------
                        // FFprobe Detect Metadata
                        // -------------------------
                        FFprobe.Metadata(mainwindow);

                        // -------------------------
                        // FFmpeg Generate Arguments (Single)
                        // -------------------------
                        //disabled if batch
                        FFmpeg.FFmpegSingleGenerateArgs(mainwindow);
                    }

                    // -------------------------
                    // Batch
                    // -------------------------
                    else if (mainwindow.tglBatch.IsChecked == true)
                    {
                        // -------------------------
                        // FFprobe Video Entry Type Containers
                        // -------------------------
                        //FFprobe.VideoEntryTypeBatch(this);
                        FFprobe.VideoEntryType(mainwindow);

                        // -------------------------
                        // FFprobe Video Entry Type Containers
                        // -------------------------
                        //FFprobe.AudioEntryTypeBatch(this);
                        FFprobe.AudioEntryType(mainwindow);

                        // -------------------------
                        // FFmpeg Generate Arguments (Batch)
                        // -------------------------
                        //disabled if single file
                        FFmpeg.FFmpegBatchGenerateArgs(mainwindow);
                    }
                }); //end dispatcher
            });     //end thread


            // When background worker completes task
            fileprocess.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object o, RunWorkerCompletedEventArgs args)
            {
                // -------------------------
                // Write Variables to Debug Window
                // -------------------------
                DebugWrite(this, mainwindow);

                // -------------------------
                // Close the Background Worker
                // -------------------------
                fileprocess.CancelAsync();
                fileprocess.Dispose();

                // -------------------------
                // Clear Variables for next Run
                // -------------------------
                MainWindow.ClearVariables(mainwindow);
                GC.Collect();
            }); //end worker completed task


            // -------------------------
            // Background Worker Run Async
            // -------------------------
            fileprocess.RunWorkerAsync();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Cut End
        /// </summary>
        public static String CutEnd(string input_Text,
                                    bool batch_IsChecked,
                                    string mediaType_SelectedItem,
                                    string cut_SelectedItem,
                                    string cutEnd_Text_Hours,
                                    string cutEnd_Text_Minutes,
                                    string cutEnd_Text_Seconds,
                                    string cutEnd_Text_Milliseconds,
                                    string frameEnd_Text
                                    )
        {
            // -------------------------
            // Yes
            // -------------------------
            if (cut_SelectedItem == "Yes")
            {
                // Video, Image Sequence, Audio
                // Image only has Start, no End
                if (mediaType_SelectedItem != "Image")
                {
                    // -------------------------
                    // Time
                    // -------------------------
                    // If Frame Textboxes Default Use Time
                    if (string.IsNullOrEmpty(frameEnd_Text))
                    {
                        // End
                        trimEnd = cutEnd_Text_Hours.PadLeft(2, '0') + ":" +
                                  cutEnd_Text_Minutes.PadLeft(2, '0') + ":" +
                                  cutEnd_Text_Seconds.PadLeft(2, '0') + "." +
                                  cutEnd_Text_Milliseconds.PadLeft(3, '0');

                        // If End Time is Empty, Default to Full Duration
                        // Input Null Check
                        if (!string.IsNullOrEmpty(input_Text))
                        {
                            if (trimEnd == "00:00:00.000" ||
                                string.IsNullOrEmpty(trimEnd))
                            {
                                trimEnd = FFprobe.CutDuration(input_Text, batch_IsChecked);
                            }
                        }
                    }

                    // -------------------------
                    // Frames
                    // -------------------------
                    // If Frame Textboxes have Text, but not Default,
                    // use FramesToDecimal Method (Override Time)
                    else if (!string.IsNullOrEmpty(frameEnd_Text))
                    {
                        trimEnd = Video.FramesToDecimal(frameEnd_Text);
                    }


                    trimEnd = "-to " + trimEnd;
                }
            }

            // -------------------------
            // No
            // -------------------------
            else if (cut_SelectedItem == "No")
            {
                trimEnd = string.Empty;
            }

            // Return Value
            return(trimEnd);
        }
Exemplo n.º 5
0
        /// <summary>
        ///    FFprobe Detect Metadata (Method)
        /// </summary>
        public static void Metadata(MainWindow mainwindow)
        {
            // --------------------------------------------------------------------
            // Section: FFprobe
            // --------------------------------------------------------------------

            // Log Console Message /////////
            Log.WriteAction = () =>
            {
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new Bold(new Run("FFprobe"))
                {
                    Foreground = Log.ConsoleTitle
                });
            };
            Log.LogActions.Add(Log.WriteAction);


            // Only Run FFprobe if Input File is Not Null
            // Strange FFprobe Class problem - methods halting after InputFileInfo()
            // unless Null Check is put here instead of inside the Class.
            if (!string.IsNullOrWhiteSpace(mainwindow.tbxInput.Text)
                //&& !string.IsNullOrEmpty(MainWindow.inputDir)
                && !string.IsNullOrEmpty(FFprobe.ffprobe))
            {
                // -------------------------
                //    FFprobe Video Entry Type Containers
                // -------------------------
                FFprobe.VideoEntryType(mainwindow);

                // -------------------------
                //    FFprobe Audio Entry Type Containers
                // -------------------------
                FFprobe.AudioEntryType(mainwindow);

                // -------------------------
                //    FFprobe File Info
                // -------------------------
                argsFrameRate    = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams v:0 -show_entries stream=r_frame_rate -v quiet -of csv=\"p=0\"";
                argsSize         = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams v:0 -show_entries format=size -v quiet -of csv=\"p=0\"";
                argsDuration     = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams v:0 -show_entries format=duration -v quiet -of csv=\"p=0\"";
                argsVideoCodec   = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams v:0 -show_entries stream=codec_name -v quiet -of csv=\"p=0\"";
                argsVideoBitrate = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams v:0 -show_entries " + vEntryType + " -v quiet -of csv=\"p=0\"";
                argsAudioCodec   = " -i " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams a:0 -show_entries stream=codec_name -v quiet -of csv=\"p=0\"";
                argsAudioBitrate = " -i" + " " + "\"" + mainwindow.tbxInput.Text + "\"" + " -select_streams a:0 -show_entries " + aEntryType + " -v quiet -of csv=\"p=0\"";

                inputFrameRate    = InputFileInfo(mainwindow, argsFrameRate);
                inputSize         = InputFileInfo(mainwindow, argsSize);
                inputDuration     = InputFileInfo(mainwindow, argsDuration);
                inputVideoCodec   = InputFileInfo(mainwindow, argsVideoCodec);
                inputVideoBitrate = InputFileInfo(mainwindow, argsVideoBitrate);
                inputAudioCodec   = InputFileInfo(mainwindow, argsAudioCodec);
                inputAudioBitrate = InputFileInfo(mainwindow, argsAudioBitrate);

                // Log won't write the input data unless we pass it to a new string
                string logInputFrameRate    = inputFrameRate;
                string logInputSize         = inputSize;
                string logInputDuration     = inputDuration;
                string logInputVideoCodec   = inputVideoCodec;
                string logInputVideoBitrate = inputVideoBitrate;
                string logInputAudioCodec   = inputAudioCodec;
                string logInputAudioBitrate = inputAudioBitrate;

                // --------------------------------------------------------------------
                // Section: Input
                // --------------------------------------------------------------------
                Log.WriteAction = () =>
                {
                    // Log Console Message /////////
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Input File Details"))
                    {
                        Foreground = Log.ConsoleTitle
                    });

                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Directory: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(MainWindow.inputDir)
                    {
                        Foreground = Log.ConsoleDefault
                    });

                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("General"))
                    {
                        Foreground = Log.ConsoleAction
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());

                    Log.logParagraph.Inlines.Add(new Bold(new Run("Container: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    // Single File
                    if (!string.IsNullOrEmpty(MainWindow.inputExt))
                    {
                        Log.logParagraph.Inlines.Add(new Run(MainWindow.inputExt)
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    }
                    // Batch
                    if (!string.IsNullOrEmpty(MainWindow.batchExt) && MainWindow.batchExt != "extension")
                    {
                        Log.logParagraph.Inlines.Add(new Run(MainWindow.batchExt)
                        {
                            Foreground = Log.ConsoleDefault
                        });
                    }

                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Size: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputSize)
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Duration: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputDuration)
                    {
                        Foreground = Log.ConsoleDefault
                    });

                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Video"))
                    {
                        Foreground = Log.ConsoleAction
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Codec: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputVideoCodec)
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Bitrate: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputVideoBitrate)
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("FPS: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputFrameRate)
                    {
                        Foreground = Log.ConsoleDefault
                    });

                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Audio"))
                    {
                        Foreground = Log.ConsoleAction
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Codec: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(logInputAudioCodec)
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Bitrate: "))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                    Log.logParagraph.Inlines.Add(new Run(Convert.ToString(logInputAudioBitrate))
                    {
                        Foreground = Log.ConsoleDefault
                    });
                };
                Log.LogActions.Add(Log.WriteAction);
            }
            else
            {
                // Log Console Message /////////
                Log.WriteAction = () =>
                {
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new LineBreak());
                    Log.logParagraph.Inlines.Add(new Bold(new Run("Input File Not Found"))
                    {
                        Foreground = Log.ConsoleWarning
                    });
                };
                Log.LogActions.Add(Log.WriteAction);
            }


            // --------------------------------------------------------------------
            // Section: Output
            // --------------------------------------------------------------------
            // Log Console Message /////////
            Log.WriteAction = () =>
            {
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new Bold(new Run("Output File Settings"))
                {
                    Foreground = Log.ConsoleTitle
                });
            };
            Log.LogActions.Add(Log.WriteAction);

            // Log Console Message /////////
            Log.WriteAction = () =>
            {
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new Bold(new Run("Directory: "))
                {
                    Foreground = Log.ConsoleDefault
                });
                Log.logParagraph.Inlines.Add(new Run(MainWindow.outputDir)
                {
                    Foreground = Log.ConsoleDefault
                });
            };
            Log.LogActions.Add(Log.WriteAction);

            // --------------------------------------------------
            // Category: General
            // --------------------------------------------------
            // Log Console Message /////////
            Log.WriteAction = () =>
            {
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new Bold(new Run("General"))
                {
                    Foreground = Log.ConsoleAction
                });
            };
            Log.LogActions.Add(Log.WriteAction);


            // -------------------------
            //    Format
            // -------------------------
            // OutputFormat() is not called because it is instead used in Controls
            // Use a Message for Log Console

            // Log Console Message /////////
            Log.WriteAction = () =>
            {
                Log.logParagraph.Inlines.Add(new LineBreak());
                Log.logParagraph.Inlines.Add(new Bold(new Run("Format: "))
                {
                    Foreground = Log.ConsoleDefault
                });
                Log.logParagraph.Inlines.Add(new Run(MainWindow.outputExt)
                {
                    Foreground = Log.ConsoleDefault
                });
            };
            Log.LogActions.Add(Log.WriteAction);
        }
Exemplo n.º 6
0
        /// <summary>
        ///     Debug Test Button
        /// </summary>
        private void btnDebugTest_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainwindow = (MainWindow)System.Windows.Application.Current.MainWindow;
            ViewModel  vm         = mainwindow.DataContext as ViewModel;

            // -------------------------
            // Clear Variables before Run
            // -------------------------
            MainWindow.ClearGlobalVariables(vm);

            // -------------------------
            // Batch Extention Period Check
            // -------------------------
            MainWindow.BatchExtCheck(vm);

            // -------------------------
            // Set FFprobe Path
            // -------------------------
            MainWindow.FFprobePath(vm);

            // -------------------------
            // Set youtube-dl Path
            // -------------------------
            MainWindow.youtubedlPath(vm);

            // -------------------------
            // Ready Halts
            // -------------------------
            if (MainWindow.ReadyHalts(vm) == true)
            {
                // -------------------------
                // Single
                // -------------------------
                if (vm.Batch_IsChecked == false)
                {
                    // -------------------------
                    // FFprobe Detect Metadata
                    // -------------------------
                    FFprobe.Metadata(vm);

                    // -------------------------
                    // FFmpeg Generate Arguments (Single)
                    // -------------------------
                    //disabled if batch
                    FFmpeg.FFmpegSingleGenerateArgs(vm);
                }

                // -------------------------
                // Batch
                // -------------------------
                else if (vm.Batch_IsChecked == true)
                {
                    // -------------------------
                    // FFprobe Video Entry Type Containers
                    // -------------------------
                    FFprobe.VideoEntryType(vm);

                    // -------------------------
                    // FFprobe Video Entry Type Containers
                    // -------------------------
                    FFprobe.AudioEntryType(vm);

                    // -------------------------
                    // FFmpeg Generate Arguments (Batch)
                    // -------------------------
                    //disabled if single file
                    FFmpeg.FFmpegBatchGenerateArgs(vm);
                }

                // -------------------------
                // Write Variables to Debug Window
                // -------------------------
                DebugWrite(this, vm);

                // -------------------------
                // Clear Variables for next Run
                // -------------------------
                MainWindow.ClearGlobalVariables(vm);
                GC.Collect();
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Cut (Method)
        /// </summary>
        public static String Cut(MainWindow mainwindow)
        {
            // -------------------------
            // Yes
            // -------------------------
            // VIDEO
            //
            if ((string)mainwindow.cboCut.SelectedItem == "Yes")
            {
                if ((string)mainwindow.cboMediaType.SelectedItem == "Video")
                {
                    // Use Time
                    // If Frame Textboxes Default Use Time
                    if (mainwindow.frameStart.Text == "Frame" ||
                        mainwindow.frameEnd.Text == "Range" ||
                        string.IsNullOrWhiteSpace(mainwindow.frameStart.Text) ||
                        string.IsNullOrWhiteSpace(mainwindow.frameEnd.Text))
                    {
                        trimStart = mainwindow.cutStart.Text;
                        trimEnd   = mainwindow.cutEnd.Text;
                    }

                    // Use Frames
                    // If Frame Textboxes have Text, but not Default, use FramesToDecimal Method (Override Time)
                    else if (mainwindow.frameStart.Text != "Frame" &&
                             mainwindow.frameEnd.Text != "Range" &&
                             !string.IsNullOrWhiteSpace(mainwindow.frameStart.Text) &&
                             !string.IsNullOrWhiteSpace(mainwindow.frameEnd.Text))
                    {
                        Video.FramesToDecimal(mainwindow);
                    }

                    // If End Time is Empty, Default to Full Duration
                    // Input Null Check
                    if (!string.IsNullOrWhiteSpace(mainwindow.tbxInput.Text))
                    {
                        if (mainwindow.cutEnd.Text == "00:00:00.000" || string.IsNullOrWhiteSpace(mainwindow.cutEnd.Text))
                        {
                            trimEnd = FFprobe.CutDuration(mainwindow);
                        }
                    }

                    // Combine
                    trim = "-ss " + trimStart + " " + "-to " + trimEnd;
                }

                // AUDIO
                //
                else if ((string)mainwindow.cboMediaType.SelectedItem == "Audio")
                {
                    trimStart = mainwindow.cutStart.Text;
                    trimEnd   = mainwindow.cutEnd.Text;

                    // If End Time is Empty, Default to Full Duration
                    // Input Null Check
                    if (!string.IsNullOrWhiteSpace(mainwindow.tbxInput.Text))
                    {
                        if (mainwindow.cutEnd.Text == "00:00:00.000" || string.IsNullOrWhiteSpace(mainwindow.cutEnd.Text))
                        {
                            trimEnd = FFprobe.CutDuration(mainwindow);
                        }
                    }

                    // Combine
                    trim = "-ss " + trimStart + " " + "-to " + trimEnd;
                }

                // JPEG & PNG Screenshot
                //
                else if ((string)mainwindow.cboMediaType.SelectedItem == "Image")
                {
                    // Use Time
                    // If Frame Textbox Default Use Time
                    if (mainwindow.frameStart.Text == "Frame" || string.IsNullOrWhiteSpace(mainwindow.frameStart.Text))
                    {
                        trimStart = mainwindow.cutStart.Text;
                    }

                    // Use Frames
                    // If Frame Textboxes have Text, but not Default, use FramesToDecimal Method (Override Time)
                    else if (mainwindow.frameStart.Text != "Frame" &&
                             mainwindow.frameEnd.Text != "Range" &&
                             !string.IsNullOrWhiteSpace(mainwindow.frameStart.Text) &&
                             string.IsNullOrWhiteSpace(mainwindow.frameEnd.Text))
                    {
                        Video.FramesToDecimal(mainwindow);
                    }

                    trim = "-ss " + trimStart;
                }

                // JPEG & PNG Sequence
                //
                else if ((string)mainwindow.cboMediaType.SelectedItem == "Sequence")
                {
                    // Use Time
                    // If Frame Textboxes Default Use Time
                    if (mainwindow.frameStart.Text == "Frame" ||
                        mainwindow.frameEnd.Text == "Range" ||
                        string.IsNullOrWhiteSpace(mainwindow.frameStart.Text) ||
                        string.IsNullOrWhiteSpace(mainwindow.frameEnd.Text))
                    {
                        trimStart = mainwindow.cutStart.Text;
                        trimEnd   = mainwindow.cutEnd.Text;
                    }

                    // Use Frames
                    // If Frame Textboxes have Text, but not Default, use FramesToDecimal Method (Override Time)
                    else if (mainwindow.frameStart.Text != "Frame" &&
                             mainwindow.frameEnd.Text != "Range" &&
                             !string.IsNullOrWhiteSpace(mainwindow.frameStart.Text) &&
                             !string.IsNullOrWhiteSpace(mainwindow.frameEnd.Text))
                    {
                        Video.FramesToDecimal(mainwindow);
                    }

                    trim = "-ss " + trimStart + " " + "-to " + trimEnd;
                }
            }

            // -------------------------
            // No
            // -------------------------
            else if ((string)mainwindow.cboCut.SelectedItem == "No")
            {
                trim = string.Empty;
            }

            // Return Value
            return(trim);
        }