/// <summary> /// Encoding Pass Controls /// <summary> public static void EncodingPassControls() { switch (VM.VideoView.Video_Codec_SelectedItem) { // -------------------------------------------------- // Video // -------------------------------------------------- // ------------------------- // VP8 // ------------------------- case "VP8": VP8.EncodingPass(); break; // ------------------------- // VP9 // ------------------------- case "VP9": VP9.EncodingPass(); break; // ------------------------- // x264 // ------------------------- case "x264": x264.EncodingPass(); break; // ------------------------- // x265 // ------------------------- case "x265": x265.EncodingPass(); break; // ------------------------- // AV1 // ------------------------- case "AV1": AV1.EncodingPass(); break; // ------------------------- // FFV1 // ------------------------- case "FFV1": FFV1.EncodingPass(); break; // ------------------------- // HuffYUV // ------------------------- case "HuffYUV": HuffYUV.EncodingPass(); break; // ------------------------- // Theora // ------------------------- case "Theora": Theora.EncodingPass(); break; // ------------------------- // MPEG-2 // ------------------------- case "MPEG-2": MPEG_2.EncodingPass(); break; // ------------------------- // MPEG-4 // ------------------------- case "MPEG-4": MPEG_4.EncodingPass(); break; // -------------------------------------------------- // Image // -------------------------------------------------- // ------------------------- // JPEG // ------------------------- case "JPEG": JPEG.EncodingPass(); break; // ------------------------- // PNG // ------------------------- case "PNG": PNG.EncodingPass(); break; // ------------------------- // WebP // ------------------------- case "WebP": WebP.EncodingPass(); break; // -------------------------------------------------- // Other // -------------------------------------------------- // ------------------------- // Copy // ------------------------- case "Copy": VideoCopy.EncodingPass(); break; // ------------------------- // None // ------------------------- case "None": VideoNone.EncodingPass(); break; } // ------------------------- // CRF TextBox // ------------------------- if (VM.VideoView.Video_Quality_SelectedItem == "Custom") { // Disable if (VM.VideoView.Video_Pass_SelectedItem == "CRF") { VM.VideoView.Video_CRF_IsEnabled = true; } // Enable else if (VM.VideoView.Video_Pass_SelectedItem == "1 Pass" || VM.VideoView.Video_Pass_SelectedItem == "2 Pass" || VM.VideoView.Video_Pass_SelectedItem == "auto") { VM.VideoView.Video_CRF_IsEnabled = false; } } }
public static bool passUserSelected = false; // Used to determine if User manually selected CRF, 1 Pass or 2 Pass /// <summary> /// Set Controls /// </summary> public static void SetControls(string codec_SelectedItem) { // -------------------------------------------------- // Codec // -------------------------------------------------- // -------------------------------------------------- // Video // -------------------------------------------------- switch (codec_SelectedItem) { // ------------------------- // VP8 // ------------------------- case "VP8": // Codec VP8.Codec_Set(); // Items Source VP8.Controls_ItemsSource(); // Selected Items VP8.Controls_Selected(); // Expanded VP8.Controls_Expanded(); // Collapsed VP8.Controls_Collapsed(); // Checked VP8.Controls_Checked(); // Unhecked VP8.Controls_Unhecked(); // Enabled VP8.Controls_Enable(); // Disabled VP8.Controls_Disable(); break; // ------------------------- // VP9 // ------------------------- case "VP9": // Codec VP9.Codec_Set(); // Items Source VP9.Controls_ItemsSource(); // Selected Items VP9.Controls_Selected(); // Expanded VP9.Controls_Expanded(); // Collapsed VP9.Controls_Collapsed(); // Checked VP9.Controls_Checked(); // Unhecked VP9.Controls_Unhecked(); // Enabled VP9.Controls_Enable(); // Disabled VP9.Controls_Disable(); break; // ------------------------- // x264 // ------------------------- case "x264": // Codec x264.Codec_Set(); // Items Source x264.Controls_ItemsSource(); // Selected Items x264.Controls_Selected(); // Expanded x264.Controls_Expanded(); // Collapsed x264.Controls_Collapsed(); // Checked x264.Controls_Checked(); // Unhecked x264.Controls_Unhecked(); // Enabled x264.Controls_Enable(); // Disabled x264.Controls_Disable(); break; // ------------------------- // x265 // ------------------------- case "x265": // Codec x265.Codec_Set(); // Items Source x265.Controls_ItemsSource(); // Selected Items x265.Controls_Selected(); // Expanded x265.Controls_Expanded(); // Collapsed x265.Controls_Collapsed(); // Checked x265.Controls_Checked(); // Unhecked x265.Controls_Unhecked(); // Enabled x265.Controls_Enable(); // Disabled x265.Controls_Disable(); break; // ------------------------- // AV1 // ------------------------- case "AV1": // Codec AV1.Codec_Set(); // Items Source AV1.Controls_ItemsSource(); // Selected Items AV1.Controls_Selected(); // Expanded AV1.Controls_Expanded(); // Collapsed AV1.Controls_Collapsed(); // Checked AV1.Controls_Checked(); // Unhecked AV1.Controls_Unhecked(); // Enabled AV1.Controls_Enable(); // Disabled AV1.Controls_Disable(); break; // ------------------------- // FFV1 // ------------------------- case "FFV1": // Codec FFV1.Codec_Set(); // Items Source FFV1.Controls_ItemsSource(); // Selected Items FFV1.Controls_Selected(); // Expanded FFV1.Controls_Expanded(); // Collapsed FFV1.Controls_Collapsed(); // Checked FFV1.Controls_Checked(); // Unhecked FFV1.Controls_Unhecked(); // Enabled FFV1.Controls_Enable(); // Disabled FFV1.Controls_Disable(); break; // ------------------------- // HuffYUV // ------------------------- case "HuffYUV": // Codec HuffYUV.Codec_Set(); // Items Source HuffYUV.Controls_ItemsSource(); // Selected Items HuffYUV.Controls_Selected(); // Expanded HuffYUV.Controls_Expanded(); // Collapsed HuffYUV.Controls_Collapsed(); // Checked HuffYUV.Controls_Checked(); // Unhecked HuffYUV.Controls_Unhecked(); // Enabled HuffYUV.Controls_Enable(); // Disabled HuffYUV.Controls_Disable(); break; // ------------------------- // Theora // ------------------------- case "Theora": // Codec Theora.Codec_Set(); // Items Source Theora.Controls_ItemsSource(); // Selected Items Theora.Controls_Selected(); // Expanded Theora.Controls_Expanded(); // Collapsed Theora.Controls_Collapsed(); // Checked Theora.Controls_Checked(); // Unhecked Theora.Controls_Unhecked(); // Enabled Theora.Controls_Enable(); // Disabled Theora.Controls_Disable(); break; // ------------------------- // MPEG-2 // ------------------------- case "MPEG-2": // Codec MPEG_2.Codec_Set(); // Items Source MPEG_2.Controls_ItemsSource(); // Selected Items MPEG_2.Controls_Selected(); // Expanded MPEG_2.Controls_Expanded(); // Collapsed MPEG_2.Controls_Collapsed(); // Checked MPEG_2.Controls_Checked(); // Unhecked MPEG_2.Controls_Unhecked(); // Enabled MPEG_2.Controls_Enable(); // Disabled MPEG_2.Controls_Disable(); break; // ------------------------- // MPEG-4 // ------------------------- case "MPEG-4": // Codec MPEG_4.Codec_Set(); // Items Source MPEG_4.Controls_ItemsSource(); // Selected Items MPEG_4.Controls_Selected(); // Expanded MPEG_4.Controls_Expanded(); // Collapsed MPEG_4.Controls_Collapsed(); // Checked MPEG_4.Controls_Checked(); // Unhecked MPEG_4.Controls_Unhecked(); // Enabled MPEG_4.Controls_Enable(); // Disabled MPEG_4.Controls_Disable(); break; // -------------------------------------------------- // Image // -------------------------------------------------- // ------------------------- // JPEG // ------------------------- case "JPEG": // Codec JPEG.Codec_Set(); // Items Source JPEG.Controls_ItemsSource(); // Selected Items JPEG.Controls_Selected(); // Expanded JPEG.Controls_Expanded(); // Collapsed JPEG.Controls_Collapsed(); // Checked JPEG.Controls_Checked(); // Unhecked JPEG.Controls_Unhecked(); // Enabled JPEG.Controls_Enable(); // Disabled JPEG.Controls_Disable(); break; // ------------------------- // PNG // ------------------------- case "PNG": // Codec PNG.Codec_Set(); // Items Source PNG.Controls_ItemsSource(); // Selected Items PNG.Controls_Selected(); // Expanded PNG.Controls_Expanded(); // Collapsed PNG.Controls_Collapsed(); // Checked PNG.Controls_Checked(); // Unhecked PNG.Controls_Unhecked(); // Enabled PNG.Controls_Enable(); // Disabled PNG.Controls_Disable(); break; // ------------------------- // WebP // ------------------------- case "WebP": // Codec WebP.Codec_Set(); // Items Source WebP.Controls_ItemsSource(); // Selected Items WebP.Controls_Selected(); // Expanded WebP.Controls_Expanded(); // Collapsed WebP.Controls_Collapsed(); // Checked WebP.Controls_Checked(); // Unhecked WebP.Controls_Unhecked(); // Enabled WebP.Controls_Enable(); // Disabled WebP.Controls_Disable(); break; // ------------------------- // Copy // ------------------------- case "Copy": // Codec VideoCopy.Codec_Set(); // Items Source VideoCopy.Controls_ItemsSource(); // Selected Items VideoCopy.Controls_Selected(); // Expanded VideoCopy.Controls_Expanded(); // Collapsed VideoCopy.Controls_Collapsed(); // Checked VideoCopy.Controls_Checked(); // Unhecked VideoCopy.Controls_Unhecked(); // Enabled VideoCopy.Controls_Enable(); // Disabled VideoCopy.Controls_Disable(); break; // ------------------------- // None // ------------------------- case "None": // Codec VideoNone.Codec_Set(); // Items Source VideoNone.Controls_ItemsSource(); // Selected Items VideoNone.Controls_Selected(); // Expanded VideoNone.Controls_Expanded(); // Collapsed VideoNone.Controls_Collapsed(); // Checked VideoNone.Controls_Checked(); // Unhecked VideoNone.Controls_Unhecked(); // Enabled VideoNone.Controls_Enable(); // Disabled VideoNone.Controls_Disable(); break; } // -------------------------------------------------- // Default Selected Item // Previous Items set in ViewModel _SelectedItem // -------------------------------------------------- // ------------------------- // Video Encode Speed Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.VideoView.Video_EncodeSpeed_SelectedItem) && VM.VideoView.Video_EncodeSpeed_SelectedItem != "none") { MainWindow.Video_EncodeSpeed_PreviousItem = VM.VideoView.Video_EncodeSpeed_SelectedItem; } VM.VideoView.Video_EncodeSpeed_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_EncodeSpeed_Items.Select(c => c.Name).ToList(), MainWindow.Video_EncodeSpeed_PreviousItem ); // ------------------------- // Video Quality Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.VideoView.Video_Quality_SelectedItem) && VM.VideoView.Video_Quality_SelectedItem != "None") { MainWindow.Video_Quality_PreviousItem = VM.VideoView.Video_Quality_SelectedItem; } VM.VideoView.Video_Quality_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Quality_Items.Select(c => c.Name).ToList(), MainWindow.Video_Quality_PreviousItem ); // ------------------------- // Video Pass Selected Item // ------------------------- //if (!string.IsNullOrEmpty(VM.VideoView.Video_Pass_SelectedItem)) //{ // MainWindow.Video_EncodeSpeed_PreviousItem = VM.VideoView.Video_Pass_SelectedItem; //} //VM.VideoView.Video_Pass_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Pass_Items, // MainWindow.Video_Pass_PreviousItem // ); // ------------------------- // Video Optimize Selected Item // ------------------------- // Problem, do not use, selects Web in mp4 when coming from webm //if (!string.IsNullOrEmpty(VM.VideoView.Video_Optimize_SelectedItem) && // VM.VideoView.Video_Optimize_SelectedItem != "None") //{ // MainWindow.VideoOptimize_PreviousItem = VM.VideoView.Video_Optimize_SelectedItem; //} //VM.VideoView.Video_Optimize_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Optimize_Items.Select(c => c.Name).ToList(), // MainWindow.VideoOptimize_PreviousItem // ); }
/// <summary> /// Encoding Pass Controls /// <summary> public static void EncodingPassControls() { // -------------------------------------------------- // Video // -------------------------------------------------- // ------------------------- // VP8 // ------------------------- if (VM.VideoView.Video_Codec_SelectedItem == "VP8") { VP8.EncodingPass(); } // ------------------------- // VP9 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "VP9") { VP9.EncodingPass(); } // ------------------------- // x264 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "x264") { x264.EncodingPass(); } // ------------------------- // x265 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "x265") { x265.EncodingPass(); } // ------------------------- // AV1 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "AV1") { AV1.EncodingPass(); } // ------------------------- // FFV1 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "FFV1") { FFV1.EncodingPass(); } // ------------------------- // HuffYUV // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "HuffYUV") { HuffYUV.EncodingPass(); } // ------------------------- // Theora // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "Theora") { Theora.EncodingPass(); } // ------------------------- // MPEG-2 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "MPEG-2") { MPEG_2.EncodingPass(); } // ------------------------- // MPEG-4 // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "MPEG-4") { MPEG_4.EncodingPass(); } // -------------------------------------------------- // Image // -------------------------------------------------- // ------------------------- // JPEG // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "JPEG") { JPEG.EncodingPass(); } // ------------------------- // PNG // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "PNG") { PNG.EncodingPass(); } // ------------------------- // WebP // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "WebP") { WebP.EncodingPass(); } // -------------------------------------------------- // Other // -------------------------------------------------- // ------------------------- // Copy // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "Copy") { VideoCopy.EncodingPass(); } // ------------------------- // None // ------------------------- else if (VM.VideoView.Video_Codec_SelectedItem == "None") { VideoNone.EncodingPass(); } // ------------------------- // CRF TextBox // ------------------------- if (VM.VideoView.Video_Quality_SelectedItem == "Custom") { // Disable if (VM.VideoView.Video_Pass_SelectedItem == "CRF") { VM.VideoView.Video_CRF_IsEnabled = true; } // Enable else if (VM.VideoView.Video_Pass_SelectedItem == "1 Pass" || VM.VideoView.Video_Pass_SelectedItem == "2 Pass" || VM.VideoView.Video_Pass_SelectedItem == "auto") { VM.VideoView.Video_CRF_IsEnabled = false; } } }