private void button2_Click(object sender, EventArgs e) { if (gotu.Status == RecordStatus.Running) { gotu.Stop(); } }
//STOP CAPTURE BUTTON private void btnstop_Click_1(object sender, EventArgs e) { if (gotu.Status == RecordStatus.Running) { txtstart.Text = "Video Saved!"; gotu.Stop(); btnrecord.Enabled = true; btnstop.Visible = false; btnrecord.Visible = true; } }
private void exitToolStripMenuItem_Click(object sender, EventArgs e) { if (screenCaptureJob != null) { if (screenCaptureJob.Status == RecordStatus.Running) { screenCaptureJob.Stop(); } screenCaptureJob.Dispose(); } Environment.Exit(1); }
//Stop recording button click event private void stopButton_Click(object sender, EventArgs e) { timer1.Enabled = false; startButtonBackground.Visible = false; if (selfCapture != null) { if (selfCapture.Status == RecordStatus.Running) { selfCapture.Stop(); } } else { MessageBox.Show("Recording not started."); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (job.Status == RecordStatus.Running) { job.Stop(); } }
public void TestCleanUp() { //Close the Browser driver.Close(); //Stop the Screen Capture Job scj.Stop(); }
private void OnMouseDubRcd(object s, MouseEventArgs e) { if (rcd.Status == RecordStatus.Running) { rcd.Stop(); //rcd.Dispose(); } }
private void Form1_FormClosing(Object sender, FormClosingEventArgs e) { if (job.Status == RecordStatus.Running) { job.Stop(); job.Dispose(); } }
public void CaptureTestVideo() { ScreenCaptureJob scj = new ScreenCaptureJob(); scj.OutputScreenCaptureFileName = @"C:\Users\Selina\source\repos\MassiveDynamic\Test.avi"; scj.Start(); Thread.Sleep(2000); scj.Stop(); }
private void PictureBox2_Click(object sender, EventArgs e) { if (scr.Status == RecordStatus.Running) { scr.Stop(); metroButton1.Visible = true; metroButton2.Visible = false; DialogResult msj; msj = MetroFramework.MetroMessageBox.Show(this, "Kayıt Başarılı", "Tebrikler", MessageBoxButtons.OK, MessageBoxIcon.Information); listBox1.Items.Clear(); string[] dosyalar = System.IO.Directory.GetFiles("C:\\M.T.A.L Studio"); for (int j = 0; j < dosyalar.Length; j++) { //klasörler dizisinin i. elemanı listboxa ekle listBox1.Items.Add(dosyalar[j]); } } }
private void StopButton_Click(object sender, System.EventArgs e) { stopButton.Enabled = false; startButton.Enabled = true; ScreenCaptureJob.Stop(); ScreenCaptureJob.Dispose(); ScreenCaptureJob = null; }
public void StopScreenRecording(ScenarioContext scenarioContext) { var videoFileName = VideoRecorder.ScreenCaptureFileName; VideoRecorder.Stop(); if (scenarioContext.TestError == null) { File.Delete(videoFileName); } }
/// <summary> /// 停止录制 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnStopJob_Click(object sender, EventArgs e) { //隐藏窗体 this.Visible = true; BtnStartJob.Enabled = true; BtnStopJob.Enabled = false; SCJ.Stop(); //停止录制 trans = new Thread(new ThreadStart(this.Trans_Code)); //实例化线程对象 trans.Start(); //开始转码 }
private void StopBtn_Click(object sender, RoutedEventArgs e) { try { jobsc.Stop(); } catch (Exception ex) { Console.WriteLine("ex: " + ex.ToString()); } }
private void buttonStartStop_Click(object sender, EventArgs e) { if (job.Status == RecordStatus.Running || job.Status == RecordStatus.Paused) { buttonPauseResume.Enabled = false; buttonPauseResume.Text = "Pause"; job.Stop(); buttonStartStop.Text = "Saving..."; if (job.Status != RecordStatus.Running) { Encode(); } buttonStartStop.Text = "Start"; } else { StartRecording(); } }
private void buttonStartStopRecord_Click(object sender, EventArgs e) { if (job.Status == RecordStatus.Running || job.Status == RecordStatus.Paused) { buttonPauseResumeRecord.Enabled = false; buttonPauseResumeRecord.Image = Image.FromFile(Application.StartupPath + "\\pause.png"); job.Stop(); buttonStartStopRecord.Image = Image.FromFile(Application.StartupPath + "\\wait.png"); if (job.Status != RecordStatus.Running) { Encode(); } buttonStartStopRecord.Image = Image.FromFile(Application.StartupPath + "\\start.png"); } else { StartRecording(); } }
public void TearDown() { bool deleteRecording = true; try { if (TestContext.CurrentContext.Result.Status == TestStatus.Failed || TestContext.CurrentContext.Result.Status == TestStatus.Inconclusive) { deleteRecording = false; // Want to pause to view problem on video recording before shutting down browser Thread.Sleep(3000); } } catch (Exception ex) { CCWebUIAuto.HandleException(ex); } finally { Trace.WriteLine("Closing browser."); CCWebUIAuto.webDriver.Quit(); if (ClickPortalUI.AutoConfig.ContainsKey("EnableVideoRecording")) { if (ClickPortalUI.AutoConfig["EnableVideoRecording"].ToLower() == "true") { scj.Stop(); } scj.Dispose(); if (deleteRecording == true) { Trace.WriteLine("Removing unnecessary test recording: " + _testScreenCaptureFileName); File.Delete(_testScreenCaptureFileName); } } // kill any remaining IE or IEDriverServer processes var procCollection = Process.GetProcesses(); foreach (var proc in procCollection) { if (proc.ProcessName.StartsWith("iexplore") || (proc.ProcessName.StartsWith("IEDriverServer"))) { try { //proc.Kill(); } catch (Exception ex) { CCWebUIAuto.HandleException(ex); } } } } }
public void TestMethod() { if (scriptRecording.Equals("true")) { scj = new ScreenCaptureJob(); scj.OutputScreenCaptureFileName = "E:\\" + this.GetType().Name + ".avi"; scj.Start(); } Thread.Sleep(3000); scj.Stop(); }
/// <summary> /// Stops video recording, and delete file if test passed succesifully /// </summary> protected void StopRecording(TestContext context) { if (recorder.Status == RecordStatus.Running) { recorder.Stop(); recorder.Dispose(); } if (context.Result.Outcome.Status != TestStatus.Failed) { File.Delete(filepath); } }
private void buttonRecord_Click(object sender, EventArgs e) { if (buttonRecord.Text.StartsWith("Record")) { StartRecording(); buttonRecord.Text = "Stop"; } else if (job.Status == RecordStatus.Running) { job.Stop(); buttonRecord.Text = "Record"; } }
private void timer1_Tick(object sender, System.EventArgs e) { myTimer.Stop(); Console.WriteLine("Текущее время: " + DateTime.Now.ToLongTimeString()); _screenCaptureJob.Stop(); _screenCaptureJob.Stop(); var ffMpeg = new NReco.VideoConverter.FFMpegConverter(); ffMpeg.ConvertMedia(file, null, // autodetect by input file extension "output.mp4", null, // autodetect by output file extension new NReco.VideoConverter.ConvertSettings() { // CustomOutputArgs = " -filter_complex \"[0] yadif=0:-1:0,scale=iw*sar:ih,scale='if(gt(a,16/9),1280,-2)':'if(gt(a,16/9),-2,720)'[scaled];[scaled] pad=1280:720:(ow-iw)/2:(oh-ih)/2:black \" -c:v libx264 -c:a mp3 -ab 128k " CustomOutputArgs = " -vcodec msmpeg4v2 -c:v libx264 -crf 24 -r 20 -b:v 500k" } ); }
private void Main_FormClosing(object sender, FormClosingEventArgs e) { // checks if the job is running and if so prompts to continue if (job != null) { if (job.Status == RecordStatus.Running) { DialogResult result = MessageBox.Show("Capturing in Progress. Are You Sure You Want To Quit?", "HD-Screen Recorder", MessageBoxButtons.YesNo); if (result == DialogResult.No) { e.Cancel = true; return; } else { job.Stop(); job.Dispose(); } } } Properties.Settings.Default.OutputPath = OutputPath; Properties.Settings.Default.Save(); }
//Function for stopping the recording once the button has been pressed private void button17_Click(object sender, EventArgs e) { if (screenCap.Status == RecordStatus.Running) { screenCap.Stop(); } provideFeedback(); //Frame temp = currentSign.First(); //List<Hand> hands = temp.Hands; //label3.Text = "" + currentSign.Count(); //Console.WriteLine("currentSign Count = " + currentSign.Count); }
/// <summary> /// 停止录制 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { label1.Text = "正在处理..."; screencapturejob.Stop(); //停止录制job string xescfile = GetxescPath(); //获取录制文件路径 MediaItem src = new MediaItem(xescfile); //加入转换媒体 //获取屏幕信息 Rectangle rect = new Rectangle(); rect = Screen.PrimaryScreen.Bounds; // Screen.AllScreens //重新定义视频格式 src.OutputFormat = new WindowsMediaOutputFormat(); src.OutputFormat.VideoProfile = new AdvancedVC1VideoProfile(); src.OutputFormat.VideoProfile.Bitrate = new VariableConstrainedBitrate(1000, 1500); src.OutputFormat.VideoProfile.Size = new Size(rect.Width, rect.Height); src.OutputFormat.VideoProfile.FrameRate = 30; src.OutputFormat.VideoProfile.KeyFrameDistance = new TimeSpan(0, 0, 4); //重新定义音频格式 src.OutputFormat.AudioProfile = new WmaAudioProfile(); src.OutputFormat.AudioProfile.Bitrate = new VariableConstrainedBitrate(128, 192); //src.OutputFormat.AudioProfile.Codec = AudioCodec.WmaProfessional; src.OutputFormat.AudioProfile.BitsPerSample = 24; Job encoderjob = new Job(); //实例化转换作业 encoderjob.MediaItems.Add(src); //添加xesc文件 //encoderjob.ApplyPreset(Presets.VC1HD720pVBR);//设置视频编码 encoderjob.CreateSubfolder = false; //不创建文件夹 encoderjob.OutputDirectory = "C:\\output"; //设置转换完后的文件保存目录 encoderjob.EncodeCompleted += job2_EncodeCompleted; encoderjob.Encode(); if (File.Exists(xescfile)) { File.Delete(xescfile); } if (Directory.Exists(path)) { Directory.Delete(path); } }
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) { } }
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(); }
public static void StopRecordingVideo() { if (testEInfo.isRecording) { string filename = job.ScreenCaptureFileName; job.Stop(); if (AutomationLogging.countOfError > 0) { MediaItem src = new MediaItem(filename); Job jb = new Job(); jb.MediaItems.Add(src); jb.ApplyPreset(Presets.VC1HD720pVBR); jb.OutputDirectory = AutomationLogging.newLocationInResultFolder; string output = ((Microsoft.Expression.Encoder.JobBase)(jb)).ActualOutputDirectory; jb.Encode(); } File.Delete(filename); } }
/// <summary> /// Stop Video Recording /// </summary> public static void StopVideoRecord() { job.Stop(); Logger.Info("Stopped Video Recording.", null); }
public void Stop() { scj.Stop(); }
public void StopRecording() { _screenCaptureJob.Stop(); _screenCaptureJob.Dispose(); }