Exemple #1
0
        private void SetWMAOutput(ref VFWMAOutput wmaOutput)
        {
            if (wmvSettingsDialog == null)
            {
                wmvSettingsDialog = new WMVSettingsDialog(VideoEdit1);
            }

            wmvSettingsDialog.WMA = true;
            wmvSettingsDialog.SaveSettings(ref wmaOutput);
        }
        public void SetWMAOutput(ref VFWMAOutput wmaOutput, VideoCaptureCore core)
        {
            if (wmvSettingsDialog == null)
            {
                wmvSettingsDialog = new WMVSettingsDialog(core);
            }

            wmvSettingsDialog.WMA = true;
            wmvSettingsDialog.SaveSettings(ref wmaOutput);
        }
Exemple #3
0
        /// <summary>
        /// Loads WMA settings.
        /// </summary>
        /// <param name="wmaOutput">
        /// WMA settings.
        /// </param>
        public void LoadSettings(VFWMAOutput wmaOutput)
        {
            //if (WMA && !_loaded)
            //{
            //    cbWMVInternalProfile9.Text = "Windows Media Audio 9 High (192K)";
            //}

            switch (wmaOutput.Mode)
            {
            case VFWMVMode.ExternalProfile:
                rbWMVExternal.Checked = true;
                edWMVProfile.Text     = wmaOutput.External_Profile_FileName;
                break;

            case VFWMVMode.InternalProfile:
                rbWMVInternal9.Checked = true;
                if (!string.IsNullOrEmpty(wmaOutput.Internal_Profile_Name))
                {
                    cbWMVInternalProfile9.Text = wmaOutput.Internal_Profile_Name;
                }

                break;

            case VFWMVMode.CustomSettings:
            {
                rbWMVCustom.Checked = true;

                cbWMVAudioCodec.Text       = wmaOutput.Custom_Audio_Codec;
                cbWMVAudioFormat.Text      = wmaOutput.Custom_Audio_Format;
                edWMVAudioPeakBitrate.Text = wmaOutput.Custom_Audio_PeakBitrate.ToString();

                switch (wmaOutput.Custom_Audio_Mode)
                {
                case VFWMVStreamMode.CBR:
                    cbWMVAudioMode.Text = "CBR";
                    break;

                case VFWMVStreamMode.VBRQuality:
                    cbWMVAudioMode.Text = "Quality";
                    break;

                case VFWMVStreamMode.VBRBitrate:
                    cbWMVAudioMode.Text = "VBR";
                    break;

                case VFWMVStreamMode.VBRPeakBitrate:
                    cbWMVAudioMode.Text = "VBR (Peak)";
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                cbWMVAudioEnabled.Checked = wmaOutput.Custom_Audio_StreamPresent;
            }
            break;

            case VFWMVMode.V8SystemProfile:

                rbWMVInternal8.Checked = true;

                if (!string.IsNullOrEmpty(wmaOutput.V8ProfileName))
                {
                    cbWMVInternalProfile8.Text = wmaOutput.V8ProfileName;
                }

                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #4
0
        /// <summary>
        /// Fills WMA settings.
        /// </summary>
        /// <param name="wmaOutput">
        /// WMA settings.
        /// </param>
        public void SaveSettings(ref VFWMAOutput wmaOutput)
        {
            //if (WMA && !_loaded)
            //{
            //    cbWMVInternalProfile9.Text = "Windows Media Audio 9 High (192K)";
            //}

            if (rbWMVInternal9.Checked)
            {
                wmaOutput.Mode = VFWMVMode.InternalProfile;

                if (cbWMVInternalProfile9.SelectedIndex != -1)
                {
                    wmaOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text;
                }
            }
            else if (rbWMVInternal8.Checked)
            {
                wmaOutput.Mode = VFWMVMode.V8SystemProfile;

                if (cbWMVInternalProfile8.SelectedIndex != -1)
                {
                    wmaOutput.V8ProfileName = cbWMVInternalProfile8.Text;
                }
            }
            else if (rbWMVExternal.Checked)
            {
                wmaOutput.Mode = VFWMVMode.ExternalProfile;
                wmaOutput.External_Profile_FileName = edWMVProfile.Text;
            }
            else
            {
                wmaOutput.Mode = VFWMVMode.CustomSettings;

                wmaOutput.Custom_Audio_Codec       = cbWMVAudioCodec.Text;
                wmaOutput.Custom_Audio_Format      = cbWMVAudioFormat.Text;
                wmaOutput.Custom_Audio_PeakBitrate = Convert.ToInt32(edWMVAudioPeakBitrate.Text);

                string s = cbWMVAudioMode.Text;
                if (s == "CBR")
                {
                    wmaOutput.Custom_Audio_Mode = VFWMVStreamMode.CBR;
                }
                else if (s == "VBR")
                {
                    wmaOutput.Custom_Audio_Mode = VFWMVStreamMode.VBRBitrate;
                }
                else if (s == "VBR (Peak)")
                {
                    wmaOutput.Custom_Audio_Mode = VFWMVStreamMode.VBRPeakBitrate;
                }
                else
                {
                    wmaOutput.Custom_Audio_Mode = VFWMVStreamMode.VBRQuality;
                }

                wmaOutput.Custom_Audio_StreamPresent = cbWMVAudioEnabled.Checked;

                wmaOutput.Custom_Profile_Name = "My_Profile_1";
            }
        }
Exemple #5
0
        private async void BtStart_Click(object sender, EventArgs e)
        {
            VideoEdit1.Debug_Mode      = cbDebugMode.Checked;
            VideoEdit1.Debug_Telemetry = cbTelemetry.Checked;

            mmLog.Clear();

            VideoEdit1.Mode = VFVideoEditMode.Convert;

            VideoEdit1.Video_Effects_Clear();
            VideoEdit1.Video_Resize = cbResize.Checked;

            if (VideoEdit1.Video_Resize)
            {
                VideoEdit1.Video_Resize_Width  = Convert.ToInt32(edWidth.Text);
                VideoEdit1.Video_Resize_Height = Convert.ToInt32(edHeight.Text);
            }

            VideoEdit1.Video_FrameRate = Convert.ToDouble(cbFrameRate.Text, CultureInfo.InvariantCulture);

            VideoEdit1.Output_Filename = edOutput.Text;

            switch (cbOutputVideoFormat.SelectedIndex)
            {
            case 0:
            {
                var aviOutput = new VFAVIOutput();
                SetAVIOutput(ref aviOutput);
                VideoEdit1.Output_Format = aviOutput;
                break;
            }

            case 1:
            {
                var mkvOutput = new VFMKVv1Output();
                SetMKVOutput(ref mkvOutput);
                VideoEdit1.Output_Format = mkvOutput;
                break;
            }

            case 2:
            {
                var wmvOutput = new VFWMVOutput();
                SetWMVOutput(ref wmvOutput);
                VideoEdit1.Output_Format = wmvOutput;
                break;
            }

            case 3:
            {
                var dvOutput = new VFDVOutput();
                SetDVOutput(ref dvOutput);
                VideoEdit1.Output_Format = dvOutput;
                break;
            }

            case 4:
            {
                var acmOutput = new VFACMOutput();
                SetACMOutput(ref acmOutput);
                VideoEdit1.Output_Format = acmOutput;
                break;
            }

            case 5:
            {
                var mp3Output = new VFMP3Output();
                SetMP3Output(ref mp3Output);
                VideoEdit1.Output_Format = mp3Output;
                break;
            }

            case 6:
            {
                var m4aOutput = new VFM4AOutput();
                SetM4AOutput(ref m4aOutput);
                VideoEdit1.Output_Format = m4aOutput;
                break;
            }

            case 7:
            {
                var wmaOutput = new VFWMAOutput();
                SetWMAOutput(ref wmaOutput);
                VideoEdit1.Output_Format = wmaOutput;
                break;
            }

            case 8:
            {
                var oggVorbisOutput = new VFOGGVorbisOutput();
                SetOGGOutput(ref oggVorbisOutput);
                VideoEdit1.Output_Format = oggVorbisOutput;
                break;
            }

            case 9:
            {
                var flacOutput = new VFFLACOutput();
                SetFLACOutput(ref flacOutput);
                VideoEdit1.Output_Format = flacOutput;
                break;
            }

            case 10:
            {
                var speexOutput = new VFSpeexOutput();
                SetSpeexOutput(ref speexOutput);
                VideoEdit1.Output_Format = speexOutput;
                break;
            }

            case 11:
            {
                var customOutput = new VFCustomOutput();
                SetCustomOutput(ref customOutput);
                VideoEdit1.Output_Format = customOutput;
                break;
            }

            case 12:
            {
                var webmOutput = new VFWebMOutput();
                SetWebMOutput(ref webmOutput);
                VideoEdit1.Output_Format = webmOutput;
                break;
            }

            case 13:
            {
                var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                VideoEdit1.Output_Format = ffmpegDLLOutput;
                break;
            }

            case 14:
            {
                var ffmpegOutput = new VFFFMPEGEXEOutput();
                SetFFMPEGEXEOutput(ref ffmpegOutput);
                VideoEdit1.Output_Format = ffmpegOutput;
                break;
            }

            case 15:
            {
                var mp4Output = new VFMP4v8v10Output();
                SetMP4v10Output(ref mp4Output);
                VideoEdit1.Output_Format = mp4Output;
                break;
            }

            case 16:
            {
                var mp4Output = new VFMP4v11Output();
                SetMP4v11Output(ref mp4Output);
                VideoEdit1.Output_Format = mp4Output;
                break;
            }

            case 17:
            {
                var gifOutput = new VFAnimatedGIFOutput();
                SetGIFOutput(ref gifOutput);
                VideoEdit1.Output_Format = gifOutput;
                break;
            }

            case 18:
                MessageBox.Show("Please use Main Demo to create encrypted files.");
                return;
            }

            VideoEdit1.Audio_Preview_Enabled = true;

            await VideoEdit1.StartAsync();
        }
Exemple #6
0
        private void btStart_Click(object sender, RoutedEventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            VideoCapture1.Audio_CaptureDevice                = cbAudioInputDevice.Text;
            VideoCapture1.Audio_OutputDevice                 = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format         = cbAudioInputFormat.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = false;
            VideoCapture1.Audio_CaptureDevice_Line           = cbAudioInputLine.Text;
            VideoCapture1.Audio_PlayAudio = cbPlayAudio.IsChecked == true;
            VideoCapture1.Video_Renderer.VideoRendererInternal = VFVideoRendererInternal.None;

            if (cbMode.SelectedIndex == 0)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.AudioPreview;
                VideoCapture1.Audio_RecordAudio = true;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.AudioCapture;
                VideoCapture1.Audio_RecordAudio = true;
                VideoCapture1.Output_Filename   = edOutput.Text;

                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var acmOutput = new VFACMOutput();
                    SetACMOutput(ref acmOutput);
                    VideoCapture1.Output_Format = acmOutput;

                    break;
                }

                case 1:
                {
                    var mp3Output = new VFMP3Output();
                    SetMP3Output(ref mp3Output);
                    VideoCapture1.Output_Format = mp3Output;

                    break;
                }

                case 2:
                {
                    var wmaOutput = new VFWMAOutput();
                    SetWMAOutput(ref wmaOutput);
                    VideoCapture1.Output_Format = wmaOutput;

                    break;
                }

                case 3:
                {
                    var oggVorbisOutput = new VFOGGVorbisOutput();
                    SetOGGOutput(ref oggVorbisOutput);
                    VideoCapture1.Output_Format = oggVorbisOutput;

                    break;
                }

                case 4:
                {
                    var flacOutput = new VFFLACOutput();
                    SetFLACOutput(ref flacOutput);
                    VideoCapture1.Output_Format = flacOutput;

                    break;
                }

                case 5:
                {
                    var speexOutput = new VFSpeexOutput();
                    SetSpeexOutput(ref speexOutput);
                    VideoCapture1.Output_Format = speexOutput;

                    break;
                }

                case 6:
                {
                    var m4aOutput = new VFM4AOutput();
                    SetM4AOutput(ref m4aOutput);
                    VideoCapture1.Output_Format = m4aOutput;

                    break;
                }
                }
            }

            // Audio processing
            VideoCapture1.Audio_Effects_Clear(-1);
            VideoCapture1.Audio_Effects_Enabled = true;

            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Amplify, cbAudAmplifyEnabled.IsChecked == true, -1, -1);
            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Equalizer, cbAudEqualizerEnabled.IsChecked == true, -1, -1);
            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.TrueBass, cbAudTrueBassEnabled.IsChecked == true, -1, -1);
            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Sound3D, cbAudSound3DEnabled.IsChecked == true, -1, -1);

            VideoCapture1.Start();
        }
        public void FillSettings(VFVideoCaptureOutputFormat format, VideoCaptureCore core)
        {
            switch (format)
            {
            case VFVideoCaptureOutputFormat.AVI:
            {
                var aviOutput = new VFAVIOutput();
                SetAVIOutput(ref aviOutput, core);
                core.Output_Format = aviOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WMV:
            {
                var wmvOutput = new VFWMVOutput();
                SetWMVOutput(ref wmvOutput, core);
                core.Output_Format = wmvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DV:
            {
                var dvOutput = new VFDVOutput();
                SetDVOutput(ref dvOutput);
                core.Output_Format = dvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MKVv1:
            {
                var mkvOutput = new VFMKVv1Output();
                SetMKVOutput(ref mkvOutput, core);
                core.Output_Format = mkvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.PCM_ACM:
            {
                var acmOutput = new VFACMOutput();
                SetACMOutput(ref acmOutput, core);
                core.Output_Format = acmOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WMA:
            {
                var wmaOutput = new VFWMAOutput();
                SetWMAOutput(ref wmaOutput, core);
                core.Output_Format = wmaOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MP3:
            {
                var mp3Output = new VFMP3Output();
                SetMP3Output(ref mp3Output);
                core.Output_Format = mp3Output;

                break;
            }

            case VFVideoCaptureOutputFormat.Custom:
            {
                var customOutput = new VFCustomOutput();
                SetCustomOutput(ref customOutput, core);
                core.Output_Format = customOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureDV:
            {
                core.Output_Format = new VFDirectCaptureDVOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMPEG:
            {
                core.Output_Format = new VFDirectCaptureMPEGOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureAVI:
            {
                core.Output_Format = new VFDirectCaptureAVIOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMKV:
            {
                core.Output_Format = new VFDirectCaptureMKVOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_DLL:
            {
                var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                core.Output_Format = ffmpegDLLOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WebM:
            {
                var webmOutput = new VFWebMOutput();
                SetWebMOutput(ref webmOutput);
                core.Output_Format = webmOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMP4_GDCL:
            {
                var directCaptureOutputGDCL = new VFDirectCaptureMP4Output();
                SetDirectCaptureCustomOutput(ref directCaptureOutputGDCL, core);
                directCaptureOutputGDCL.Muxer = VFDirectCaptureMP4Muxer.GDCL;
                core.Output_Format            = directCaptureOutputGDCL;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMP4_Monogram:
            {
                var directCaptureOutputMG = new VFDirectCaptureMP4Output();
                SetDirectCaptureCustomOutput(ref directCaptureOutputMG, core);
                directCaptureOutputMG.Muxer = VFDirectCaptureMP4Muxer.Monogram;
                core.Output_Format          = directCaptureOutputMG;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureCustom:
            {
                var directCaptureOutput = new VFDirectCaptureCustomOutput();
                SetDirectCaptureCustomOutput(ref directCaptureOutput, core);
                core.Output_Format = directCaptureOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4_CUDA:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v8v10:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v11:
            {
                var mp4Output = new VFMP4v11Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.Encrypted:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                mp4Output.Encryption = true;
                core.Output_Format   = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.FLAC:
            {
                var flacOutput = new VFFLACOutput();
                SetFLACOutput(ref flacOutput);
                core.Output_Format = flacOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.OggVorbis:
            {
                var oggVorbisOutput = new VFOGGVorbisOutput();
                SetOGGOutput(ref oggVorbisOutput);
                core.Output_Format = oggVorbisOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.Speex:
            {
                var speexOutput = new VFSpeexOutput();
                SetSpeexOutput(ref speexOutput);
                core.Output_Format = speexOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_EXE:
            {
                var ffmpegOutput = new VFFFMPEGEXEOutput();
                SetFFMPEGEXEOutput(ref ffmpegOutput);
                core.Output_Format = ffmpegOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.M4A:
            {
                var m4aOutput = new VFM4AOutput();
                SetM4AOutput(ref m4aOutput);
                core.Output_Format = m4aOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.AnimatedGIF:
            {
                var gifOutput = new VFAnimatedGIFOutput();
                SetGIFOutput(ref gifOutput);
                core.Output_Format = gifOutput;
                break;
            }

            case VFVideoCaptureOutputFormat.VLC_EXE:
            {
                var vlcOutput = new VFVLCEXEOutput();
                //SetGIFOutput(ref gifOutput);
                core.Output_Format = vlcOutput;
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
            }
        }