//Function which sets the recording are for the screen capture and begins the recording
        void startRecord()
        {
            screenCap = new ScreenCaptureJob();

            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(this.panel1.Location.X + 780, this.panel1.Location.Y + 330, this.panel1.Size.Width - 50, this.panel1.Size.Height - 170);

            screenCap.CaptureRectangle     = captureRect;
            screenCap.ShowFlashingBoundary = true;
            screenCap.ShowCountdown        = true;
            //screenCap.CaptureMouseCursor = true;
            //screenCap.AddAudioDeviceSource(AudioDevices());
            //screenCap.OutputPath = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist";

            if (File.Exists(@"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid))
            {
                File.Delete(@"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid);
                axWindowsMediaPlayer1.URL             = "";
                screenCap.OutputScreenCaptureFileName = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid;
                screenCap.Start();
            }
            else
            {
                screenCap.OutputScreenCaptureFileName = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid;
                screenCap.Start();
            }
        }
Exemplo n.º 2
0
        private void StartBtn_Click(object sender, RoutedEventArgs e)
        {
            if (!jobsc.Status.ToString().Equals("Running"))
            {
                System.IO.Directory.CreateDirectory(workDir);
                jobsc = new ScreenCaptureJob();
                jobsc.ScreenCaptureVideoProfile.FrameRate = 10;
                int width  = ((int)System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width) / 4;
                int height = ((int)System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height) / 4;
                width  = width * 4;
                height = height * 4;
                System.Drawing.Rectangle capRect = new System.Drawing.Rectangle(4, 0, width, height);  //iMacros billpc slides only
                jobsc.CaptureRectangle = capRect;

                var index       = 0;
                var fileCreated = false;
                do
                {
                    if (!File.Exists(workDir + "CurrentScreenCapture" + index + ".mp4"))
                    {
                        jobsc.OutputScreenCaptureFileName = workDir + "CurrentScreenCapture" + index + ".mp4";
                        fileCreated = true;
                    }
                    index++;
                } while (!fileCreated);
                jobsc.Start();
            }
        }
Exemplo n.º 3
0
        private void StartRecording()
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                buttonPauseResume.Enabled = true;
                progressBar1.Value        = 0;
                label1.Text = " ";

                buttonStartStop.Text = "Stop";


                job = new ScreenCaptureJob();

                Size workingArea = SystemInformation.WorkingArea.Size;
                //Size workingArea = SystemInformation.PrimaryMonitorSize; //Full Screen
                Rectangle captureRect = new Rectangle(0, 0, workingArea.Width - (workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
                job.CaptureRectangle = captureRect;

                //Properties
                job.ScreenCaptureVideoProfile.FrameRate       = 60;
                job.ScreenCaptureVideoProfile.Quality         = 100;
                job.ScreenCaptureVideoProfile.SmoothStreaming = true;
                job.CaptureMouseCursor   = true;
                job.ShowCountdown        = true;
                job.ShowFlashingBoundary = true;

                job.AddAudioDeviceSource(AudioDevices());

                job.OutputPath = folderBrowserDialog1.SelectedPath + "\\";
                job.OutputScreenCaptureFileName = job.OutputPath + "ScreenCapture_" + DateTime.Today.ToString("MM-dd-yyyy ") + DateTime.Now.ToString("h.mm.ss tt") + ".xesc";

                job.Start();
            }
        }
Exemplo n.º 4
0
        //Recording function
        void StartRecording()
        {
            selfCapture = new ScreenCaptureJob();
            RECT selfRec;
            int  recordingType = Convert.ToInt32(Properties.Settings.Default["recordingType"]);

            if (recordingType == 0)
            {
                GetWindowRect(this.Handle, out selfRec);
                if (selfRec.Size.Width % 4 != 0 || selfRec.Size.Height % 4 != 0)
                {
                    selfRec.Width  = selfRec.Size.Width - selfRec.Size.Width % 4;
                    selfRec.Height = selfRec.Size.Height - selfRec.Size.Height % 4;
                }
            }

            else
            {
                Size rectArea = SystemInformation.WorkingArea.Size;
                selfRec = new RECT(0, 0, rectArea.Width - (rectArea.Width % 4), rectArea.Height - (rectArea.Height % 4));
            }

            selfCapture.CaptureRectangle     = selfRec;
            selfCapture.ShowFlashingBoundary = true;
            selfCapture.CaptureMouseCursor   = true;
            //selfCapture.ShowCountdown = true;
            selfCapture.OutputPath = Properties.Settings.Default["pictureLocation"].ToString();
            selfCapture.Start();
        }
Exemplo n.º 5
0
        //Capture, Audio and encoder settings
        void StartCapturing(bool withAudio)
        {
            gotu = new ScreenCaptureJob();                                          // creat new job

            System.Drawing.Size FullScreen  = SystemInformation.PrimaryMonitorSize; // for full screen area
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;   // for working area = (full screen - Taskbar )
            Rectangle           captureRect;

            if (Properties.Settings.Default.CaptureRect == "Full Screen")
            {
                // captureRect = new Rectangle(0, 0, FullScreen.Width , FullScreen.Height); *** this line valid in Microsoft Expression Encoder 4 SP1 and invalid in SP2
                captureRect = new Rectangle(0, 0, FullScreen.Width - (FullScreen.Width % 4), FullScreen.Height - (FullScreen.Height % 4));
            }
            else
            {
                // captureRect = new Rectangle(0, 0, WorkingArea.Width , WorkingArea.Width); *** this line valid in Microsoft Expression Encoder 4 SP1 and invalid in SP2
                captureRect = new Rectangle(0, 0, WorkingArea.Width - (WorkingArea.Width % 4), WorkingArea.Height - (WorkingArea.Height % 4));
            }

            gotu.CaptureRectangle     = captureRect;
            gotu.ShowFlashingBoundary = Properties.Settings.Default.ShowFlashing;
            gotu.ScreenCaptureVideoProfile.FrameRate = Properties.Settings.Default.FrameRate;
            gotu.ScreenCaptureVideoProfile.Quality   = Properties.Settings.Default.Quality;
            gotu.CaptureMouseCursor = Properties.Settings.Default.CaptureMC;

            if (withAudio)
            {
                gotu.AddAudioDeviceSource(AudioDevices());
            }
            gotu.ShowCountdown = Properties.Settings.Default.ShowCountdown;
            gotu.OutputPath    = gotuOutput;
            gotu.Start();
        }
        public void Setup()
        {
            const String pathname = @"..\..\autoConfig.xml";

            try
            {
                ClickPortalUI.AutoConfig.read(pathname);
                if (ClickPortalUI.AutoConfig.ContainsKey("EnableVideoRecording"))
                {
                    _testScreenCaptureFileName = @"C:\TempLogs\VideoRecordings\" + TestContext.CurrentContext.Test.FullName + ".wmv";
                    if (ClickPortalUI.AutoConfig["EnableVideoRecording"].ToLower() == "true")
                    {
                        if (File.Exists(_testScreenCaptureFileName))
                        {
                            File.Delete(_testScreenCaptureFileName);
                        }
                        scj = new ScreenCaptureJob();
                        scj.OutputScreenCaptureFileName = _testScreenCaptureFileName;
                        scj.Start();
                        Trace.WriteLine(String.Format("Starting recording for test: {0}", TestContext.CurrentContext.Test.FullName));
                    }
                }
                ClickPortalUI.Initialize();
                ((IJavaScriptExecutor)CCWebUIAuto.webDriver).ExecuteScript("window.showModalDialog = window.openWindow;");
                Trace.WriteLine(String.Format("Executing test: {0}", TestContext.CurrentContext.Test.FullName));
            }
            catch (Exception e)
            {
                ExceptionHandler.HandleException(e);
            }
        }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;

                _screenCaptureJob.CaptureRectangle     = _screenRectangle;
                _screenCaptureJob.ShowFlashingBoundary = true;
                _screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
                _screenCaptureJob.CaptureMouseCursor = true;

                _screenCaptureJob.ScreenCaptureVideoProfile.Quality = 10;

                _screenCaptureJob.OutputScreenCaptureFileName = string.Format(file);
                if (File.Exists(_screenCaptureJob.OutputScreenCaptureFileName))
                {
                    File.Delete(_screenCaptureJob.OutputScreenCaptureFileName);
                }

                myTimer.Tick += new EventHandler(timer1_Tick);

                // Sets the timer interval to 5 seconds.
                myTimer.Interval = 1000 * 30;
                myTimer.Start();

                _screenCaptureJob.Start();
            }
            catch (Exception error) {
                Console.WriteLine(error);
            }
        }
 public void Setup()
 {
     const String pathname = @"..\..\autoConfig.xml";
     try
     {
        ClickPortalUI.AutoConfig.read(pathname);
        if (ClickPortalUI.AutoConfig.ContainsKey("EnableVideoRecording"))
         {
             _testScreenCaptureFileName = @"C:\TempLogs\VideoRecordings\" + TestContext.CurrentContext.Test.FullName + ".wmv";
             if (ClickPortalUI.AutoConfig["EnableVideoRecording"].ToLower() == "true")
             {
                 if (File.Exists(_testScreenCaptureFileName))
                 {
                     File.Delete(_testScreenCaptureFileName);
                 }
                 scj = new ScreenCaptureJob();
                 scj.OutputScreenCaptureFileName = _testScreenCaptureFileName;
                 scj.Start();
                 Trace.WriteLine(String.Format("Starting recording for test: {0}", TestContext.CurrentContext.Test.FullName));
             }
         }
         ClickPortalUI.Initialize();
         ((IJavaScriptExecutor)CCWebUIAuto.webDriver).ExecuteScript("window.showModalDialog = window.openWindow;");
         Trace.WriteLine(String.Format("Executing test: {0}", TestContext.CurrentContext.Test.FullName));
     }
     catch (Exception e)
     {
         ExceptionHandler.HandleException(e);
     }
 }
 public void Start()
 {
     scj = new ScreenCaptureJob();
     if (File.Exists(OutputFile))
         File.Delete(OutputFile);
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }
Exemplo n.º 10
0
 public void SetVideoRecord()
 {
     //sj.OutputScreenCaptureFileName = @"C:\temp\test.wmv"; // 파일 저장 경로..
     sj.ScreenCaptureVideoProfile.Quality   = 100;
     sj.ScreenCaptureVideoProfile.FrameRate = 30.00;
     sj.CaptureMouseCursor = false; // 마우스 표시 여부
     //sj.AddAudioDeviceSource(EncoderDevices.FindDevices(EncoderDeviceType.Audio).ElementAt(2)); // 사운드 장치 설정
     sj.Start();
 }
Exemplo n.º 11
0
        private void StartButton_Click(object sender, System.EventArgs e)
        {
            stopButton.Enabled  = true;
            startButton.Enabled = false;

            InitializeScreenCaptureJob();

            ScreenCaptureJob.Start();
        }
Exemplo n.º 12
0
        public void CaptureTestVideo()
        {
            ScreenCaptureJob scj = new ScreenCaptureJob();

            scj.OutputScreenCaptureFileName = @"C:\Users\Selina\source\repos\MassiveDynamic\Test.avi";
            scj.Start();
            Thread.Sleep(2000);
            scj.Stop();
        }
Exemplo n.º 13
0
        /// <summary>
        /// Start Video Recording
        /// </summary>
        public static void StartVideoRecord()
        {
            job.CaptureMouseCursor = true;
            job.ScreenCaptureVideoProfile.AutoFit = true;

            job.OutputScreenCaptureFileName = AssemblyPath + "\\Results\\" + DateTime.Now.ToString("yyyy-MM-dd-hhmm-ss") + ".wmv";

            job.Start();
            Logger.Info("Started Video Recording.", null);
        }
Exemplo n.º 14
0
 public void Start()
 {
     scj = new ScreenCaptureJob();
     if (File.Exists(OutputFile))
     {
         File.Delete(OutputFile);
     }
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }
Exemplo n.º 15
0
 public static void StartRecordingVideo()
 {
     if (testEInfo.isRecording)
     {
         job = new ScreenCaptureJob();
         job.CaptureRectangle     = Screen.PrimaryScreen.Bounds;
         job.ShowFlashingBoundary = true;
         job.OutputPath           = AutomationLogging.newLocationInResultFolder;
         job.Start();
     }
 }
Exemplo n.º 16
0
        public void TestMethod()
        {
            if (scriptRecording.Equals("true"))
            {
                scj = new ScreenCaptureJob();
                scj.OutputScreenCaptureFileName = "E:\\" + this.GetType().Name + ".avi";
                scj.Start();
            }

            Thread.Sleep(3000);
            scj.Stop();
        }
Exemplo n.º 17
0
        public static void StartRecordingVideo(string scenarioTitle)
        {
            string VideoPath = Path.Combine(Directory.GetCurrentDirectory() + "\\ViedoRecords\\");

            FilesManager.CreateFolder(VideoPath);


            string timestamp = DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss");

            vidRec.OutputScreenCaptureFileName = VideoPath + scenarioTitle + " " + timestamp + ".mp4";
            vidRec.Start();
        }
Exemplo n.º 18
0
 private void StartRecording()
 {
     if (videoPath == null)
     {
         MessageBox.Show("Output path undefined!");
     }
     else
     {
         screenCaptureJob = new ScreenCaptureJob();
         SetRecordPreferences();
         screenCaptureJob.Start();
     }
 }
Exemplo n.º 19
0
        private void startRecording()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size      workingArea = SystemInformation.WorkingArea.Size;
            System.Drawing.Rectangle captureRect = new System.Drawing.Rectangle(0, 0, workingArea.Width - (workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
            job.CaptureRectangle = captureRect;

            job.ShowFlashingBoundary = true;
            job.ShowCountdown        = true;
            job.CaptureMouseCursor   = true;
            job.OutputPath           = @"D:/RecoreFolder";
            job.Start();
        }
Exemplo n.º 20
0
        public static ScreenCaptureJob CaptureRecording(Rectangle bounds, String savePath)
        {
            ScreenCaptureJob rcdJob = new ScreenCaptureJob();

            //Rectangle padded = new Rectangle(bounds.X, bounds.Y, bounds.Width - (bounds.Width % 4), bounds.Height - (bounds.Height % 4));

            rcdJob.CaptureRectangle   = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height);
            rcdJob.CaptureMouseCursor = true;
            rcdJob.OutputPath         = savePath;
            rcdJob.Start();

            return(rcdJob);
        }
Exemplo n.º 21
0
        public void TestSetup()
        {
            // Create a instance of ScreenCaptureJob from Expression Encoder
            scj = new ScreenCaptureJob();

            // Specify the path & name of the file to which Encoder will store the recording.
            // Name of Test is passed to create individual recordings of each test
            scj.OutputScreenCaptureFileName = @"C:\Results\TestGooleSearch.wmv";

            // Start the Screen Capture Job
            scj.Start();

            driver = new FirefoxDriver();
        }
Exemplo n.º 22
0
        public void TestSetup()
        {
            // Create a instance of ScreenCaptureJob from Expression Encoder
            scj = new ScreenCaptureJob();

            // Specify the path & name of the file to which Encoder will store the recording.
            // Name of Test is passed to create individual recordings of each test
            scj.OutputScreenCaptureFileName = @"C:\Results\TestGooleSearch.wmv";

            // Start the Screen Capture Job
            scj.Start();

            driver = new FirefoxDriver();
        }
        public void StartScreenRecording(ScenarioContext scenarioContext)
        {
            var nameOfTheScenario       = scenarioContext.ScenarioInfo.Title;
            var videoName               = string.Concat(nameOfTheScenario, ".wmv");
            var screenRecordingMainPath = Path
                                          .Combine(FileHelper.Instance.GetProjectBinPath(), PathToVideos);
            var screenRecordingFullPath = Path.Combine(screenRecordingMainPath, videoName);

            VideoRecorder.CaptureRectangle            = Screen.PrimaryScreen.Bounds;
            VideoRecorder.ShowFlashingBoundary        = true;
            VideoRecorder.OutputScreenCaptureFileName = screenRecordingFullPath;
            CreateScreenRecordingDirectory(screenRecordingMainPath);
            VideoRecorder.Start();
        }
 /// <summary>
 /// Procedure that initiates video capture of the test.
 /// </summary>
 /// <param name="testCasename">Name of the test suite.</param>
 public void OptionalVideoCapture(string testCasename)
 {
     var strVideo = Browser.GetConfigValue("VIDEO").ToUpper();
     IsVideoEnabled = strVideo.ToUpper() == "YES";
     if (IsVideoEnabled)
     {
         Scj = new ScreenCaptureJob
         {
             OutputScreenCaptureFileName = Browser.GetConfigValue("TEST_RESULTS_FOLDER_PATH") +
                                           DateTime.Now.ToString("yyyy-dd-MM.hh.mm.ss") +
                                           "-" + testCasename + ".wmv"
         };
         Scj.Start();
     }
 }
Exemplo n.º 25
0
        void StartRecord()
        {
            scr = new ScreenCaptureJob();

            Rectangle captureRect = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            scr.CaptureRectangle     = captureRect;
            scr.ShowFlashingBoundary = true;
            scr.ShowCountdown        = true;
            scr.CaptureMouseCursor   = true;
            scr.ScreenCaptureVideoProfile.FrameRate = 72;
            scr.AddAudioDeviceSource(AudioDevices());
            scr.OutputPath = @"C:\M.T.A.L Studio";
            scr.Start();
        }
Exemplo n.º 26
0
        //Call this method in setup method.
        public static void StartRecordingVideo()
        {
            //Provide setting in config file if you want to do recording or not.
            if (_isRecording)
            {
                _job = new ScreenCaptureJob();

                //job.CaptureRectangle = Screen.PrimaryScreen.Bounds;
                _job.ShowFlashingBoundary = true;

                //provide the location where you want to save the recording.
                _job.OutputPath = AutomationLogging.newLocationInResultFolder;

                _job.Start();
            }
        }
Exemplo n.º 27
0
        private void button3_Click(object sender, EventArgs e)
        {
            var recordFullPath = new StringBuilder(m_FolderName + @"\\SessionRecord-" + m_RecourdCount + ".wmv");

            // Check if we recording or not
            if (m_isRecord)
            {
                RecordTimer.Stop();
                screenCaptureJob.Stop();
                var chooseLessonNameForm = new LessonNameForm(recordFullPath.ToString(), m_userName, m_courseId);
                this.Hide();
                chooseLessonNameForm.ShowDialog();
                this.Show();
                button2.Enabled     = true;
                button1.Enabled     = true;
                m_isRecord          = false;
                button3.Text        = "Start Recording!";
                pictureBox3.Visible = false;
                m_RecourdCount++;
                return;
            }
            else
            {
                button2.Enabled = false;
                button1.Enabled = false;
                m_isRecord      = true;
                button3.Text    = "Stop Recording!";
                RecordTimer.Start();
            }

            try
            {
                Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;
                screenCaptureJob.CaptureRectangle     = _screenRectangle;
                screenCaptureJob.ShowFlashingBoundary = true;
                screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
                screenCaptureJob.CaptureMouseCursor = true;

                screenCaptureJob.OutputScreenCaptureFileName = recordFullPath.ToString();
                if (File.Exists(screenCaptureJob.OutputScreenCaptureFileName))
                {
                    File.Delete(screenCaptureJob.OutputScreenCaptureFileName);
                }
                screenCaptureJob.Start();
            }
            catch (Exception) { }
        }
Exemplo n.º 28
0
        void StartRecording()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           CaptureRect = new Rectangle(0, 0, WorkingArea.Width - (WorkingArea.Width % 4), WorkingArea.Height - (WorkingArea.Height % 4));

            job.CaptureRectangle     = CaptureRect;
            job.ShowFlashingBoundary = true;
            job.ShowCountdown        = true;
            job.CaptureMouseCursor   = true;
            job.AddAudioDeviceSource(AudioDevices());
            job.OutputPath = Environment.CurrentDirectory;
            //job.OutputScreenCaptureFileName = fileScreenCaptureName;

            job.Start();
            //pictureBox1.Image = job.;
        }
Exemplo n.º 29
0
        /// <summary>
        /// 开始录制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            screencapturejob.OutputPath = path;
            Collection <EncoderDevice> devices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);//查询当前所有音频设备

            foreach (EncoderDevice device in devices)
            {
                try
                {
                    screencapturejob.AddAudioDeviceSource(device);//将音频设备的声音记录
                }
                catch {
                    //抛出其他异常的音频设备
                }
            }
            //录制开始
            screencapturejob.Start();
        }
Exemplo n.º 30
0
        static void Main(string[] args)
        {
            ScreenCaptureJob job = new ScreenCaptureJob();

            // You can capture a window by setting its coordinates here
            job.CaptureRectangle = new Rectangle(100, 100, 200, 200);
            // Include the mouse pointer in the captured video
            job.CaptureMouseCursor = true;
            // Output file; you can transcode the xesc file to something else later.
            // Note that this silently does nothing if the file already exists.
            job.OutputScreenCaptureFileName = @"C:\Users\arx\scrcap\capture.xesc";
            // Do some capture
            job.Start();
            // Wait for a keypress
            Console.ReadKey();
            // And stop
            job.Stop();
        }
Exemplo n.º 31
0
        void StartRecord()

        {
            string str = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) +
                                       (@"\" + textBox1.Text));

            gotu = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(0, 0, WorkingArea.Width, WorkingArea.Height);

            gotu.CaptureRectangle     = captureRect;
            gotu.ShowFlashingBoundary = true;
            gotu.ShowCountdown        = true;
            gotu.CaptureMouseCursor   = true;
            gotu.AddAudioDeviceSource(AudioDevices());
            gotu.OutputPath  = str;
            this.WindowState = FormWindowState.Minimized;
            System.Threading.Thread.Sleep(1000);
            gotu.Start();
        }
Exemplo n.º 32
0
        void StartRecord()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(0, 0, WorkingArea.Width, WorkingArea.Height);

            job.CaptureRectangle = captureRect;

            job.ShowFlashingBoundary = false;
            job.ShowCountdown        = false;
            job.CaptureMouseCursor   = false;
            job.OutputPath           = @"C:\Users\Public\Videos";
            job.ScreenCaptureVideoProfile.Quality = 95;
            var audioDevices = Microsoft.Expression.Encoder.Devices.EncoderDevices.FindDevices(Microsoft.Expression.Encoder.Devices.EncoderDeviceType.Audio);

            job.AddAudioDeviceSource(audioDevices.ElementAt(1));
            Microsoft.Expression.Encoder.Profiles.ConstantBitrate b = new Microsoft.Expression.Encoder.Profiles.ConstantBitrate(135000);
            job.ScreenCaptureVideoProfile.Bitrate   = b;
            job.ScreenCaptureVideoProfile.FrameRate = 25.0;
            job.Start();
        }
Exemplo n.º 33
0
        public static string StartRecordVideo()
        {
            _videorec = new ScreenCaptureJob {
                CaptureRectangle          = new Rectangle(0, 0, 1920, 1040),
                ScreenCaptureVideoProfile = { Quality = 20 },
                ShowFlashingBoundary      = false
            };

            string path      = Assembly.GetCallingAssembly().CodeBase;
            string finalPath = path.Substring(0, path.LastIndexOf("bin", StringComparison.Ordinal)) + "ErrorsVideos\\" +
                               TestContext.CurrentContext.Test.FullName + "_" +
                               DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss").Replace(':', '_') +
                               ".wmv";

            finalPath = finalPath.Replace("file:///", "").Replace("/", "\\");

            _videorec.OutputScreenCaptureFileName = finalPath;
            _videorec.Start();

            return(finalPath);
        }
Exemplo n.º 34
0
        public VideoRecordingResult StartCapture()
        {
            var result = new VideoRecordingResult();

            try
            {
                Initialize();
                _screenCaptureJob.Start();
            }
            catch (Exception ex)
            {
                var argumentExceptionMessage =
                    string.Format("Video capturing failed with the following exception:{0}. Resolution: width - {1}, height - {2}. ",
                                  ex.Message,
                                  _height,
                                  _width);
                result.SavedException      = new ArgumentException(argumentExceptionMessage);
                result.IsSuccessfullySaved = false;
            }

            return(result);
        }
 public void Start()
 {
     scj = new ScreenCaptureJob();
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }