// Class constructor public MainForm( ) { InitializeComponent( ); // For debugging, instantly open the test file. FileVideoSource fileSource = new FileVideoSource(@"C:\Users\STRIDERA\Videos\ttfatf.wmv"); OpenVideoSource(fileSource); }
private void bgWorkerUser_DoWork(object sender, DoWorkEventArgs e) { DateTime dateNow = DateTime.Now; parent = db.addVideo(textBoxVideoName.Text, textBoxVideoPath.Text, dateNow.ToString()); VideoConverter vdc = new VideoConverter(); path = vdc.Convert(path); fileSource = new FileVideoSource(path); }
// Open video file using DirectShow private void openVideofileusingDirectShowToolStripMenuItem_Click( object sender, EventArgs e ) { if ( openFileDialog.ShowDialog( ) == DialogResult.OK ) { // create video source FileVideoSource fileSource = new FileVideoSource( openFileDialog.FileName ); // open it OpenVideoSource( fileSource ); } }
// Constructor public Grabber(FileVideoSource parent) { this.parent = parent; }
//private void videoPlayer_NewFrame(object sender, ref Bitmap image) //{ // if (robustChecking) // { // framesCountedForDetection++; // if (framesCountedForDetection > 5) // { // if (!plateDisplayed && lastCandidate.text != null) // { // if (lastDisplayedPlate.text == null) // { // main.HandleResults(lastCandidate); // framesCountedForDetection = 0; // lastDisplayedPlate = lastCandidate; // plateDisplayed = false; // } // else if (!lastDisplayedPlate.text.Equals(lastCandidate.text)) // { // main.HandleResults(lastCandidate); // framesCountedForDetection = 0; // lastDisplayedPlate = lastCandidate; // plateDisplayed = false; // } // } // } // } // _motionDetector.ProcessFrame(image); // //force garbage collection since we are using Bitmap's and we // //cant dispose them because of the ref to the video player // //and for some reason it doesn't let go off the resources properly // framesCountedForDisposal++; // if (framesCountedForDisposal == 10) // { // GC.Collect(); // framesCountedForDisposal = 0; // } //} private void loadVideo(String filename) { lblConnectMessage.Show(); if (fileVideoSource != null) { if (fileVideoSource.IsRunning) { CloseVideoSource(); fileVideoSource.NewFrame += null; setPicture(null); lblConnectMessage.Text = "Connecting to feed..."; } } if (File.Exists(filename)) { fileVideoSource = new FileVideoSource(filename); fileVideoSource.NewFrame += fileVideoSource_NewFrame; lblConnectMessage.Hide(); } else { lblConnectMessage.Text = "Error connecting to feed"; } }
// Constructor public Grabber( FileVideoSource parent ) { this.parent = parent; }
private void PlayRecord(object sender, EventArgs e) { VideoCaptureDeviceForm form = new VideoCaptureDeviceForm(); // create new instance of video data analyser _videDataAnalyser = new DataAnalyser(_selectedRecord, _selectedRecord.Id); // create video source FileVideoSource fileSource = new FileVideoSource(_selectedRecord.AbsolutePath); // open OpenVideoSource(fileSource); }
private void OpenRecord_Click(object sender, EventArgs e) { VideoCaptureDeviceForm form = new VideoCaptureDeviceForm(); if (openFileDialog.ShowDialog() == DialogResult.OK) { // create video source FileVideoSource fileSource = new FileVideoSource(openFileDialog.FileName); _recordToSave = new Records { AbsolutePath = openFileDialog.FileName }; // open it OpenVideoSource(fileSource); } if (RecordsGridView.Rows.Count > 0) { RecordsGridView.CurrentRow.Selected = false; } }
private void button1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { fileSource = new FileVideoSource(openFileDialog1.FileName); textBoxVideoPath.Text = openFileDialog1.FileName; textBoxVideoPath.Enabled = false; VideoConverter vdc = new VideoConverter(); path = openFileDialog1.FileName; } }
private void OpenVideofileusingDirectShowToolStripMenuItem_Click(object sender, EventArgs e) { if (OpenFileDialog.ShowDialog() == DialogResult.OK) { var fileSource = new FileVideoSource(OpenFileDialog.FileName); OpenVideoSource(fileSource); } }