Now, is anyone know how to create a program in asp web application which can play, pause and stop a video in a browser? Please.. I really need help on it. If not i cant graduate on time. :(
Play, Pause and stop a video in web application form using C# and asp.net
Now i need to complete my final year project within 1 month plus. My title is a smart surveillance system which is using my own laptop's webcam and will be email/save a snapshot to admin once it detect a motion. My supervisor want me to write the program in C# and ASP.net.
Raaj KumarPosted Feb 26, 2010, 6:17 AM
You cannot do video processing directly on the media player control. Instead process the incoming video signal from the web cam. After that send those video stream to the browser control. During video play you can take a screen shot using c#.
Below is the link which explains about taking screen shot using c#,
http://www.switchonthecode.com/tutorials/taking-some-screenshots-with-csharp
Regards,
raaj
Raaj KumarPosted Feb 25, 2010, 9:49 AM
By making use of ActiveX you can accomplish this. So windows media player comes with a browser plugin. using this you can play a video which is stored in your web application.
Here is a sample which you can make use of,
Here the text which is highlighted in red is place where you have to specify your link to the video file. For value you can use your physical path or an url to you media file.
This pulg-in works with Internet Explorer and mozilla.
Regards,
raaj
Su GeokPosted Feb 26, 2010, 11:30 PM
Can i ask you some code about C#? Now i want to know how to save the video which i recor using my webcam into a log file(by showing date and time) use Aforge C#?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
using AForge.Imaging.Filters;
using AForge.Imaging;
namespace webCamera1
{
public partial class Form1 : Form
{
private VideoCaptureDevice ChoosenVideoSoure;
private FilterInfoCollection VideoInputDevices;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
VideoInputDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (VideoInputDevices.Count != 0)
{
foreach (FilterInfo device in VideoInputDevices)
{
comboBox1.Items.Add(device.Name);
}
}
else
{
comboBox1.Items.Add("no video input device found");
start.Enabled = false;
}
comboBox1.SelectedIndex = 0;
}
private void start_Click(object sender, EventArgs e)
{
ChoosenVideoSoure = new VideoCaptureDevice(VideoInputDevices[comboBox1.SelectedIndex].MonikerString);
ChoosenVideoSoure.NewFrame += new NewFrameEventHandler(video_NewFrame); ChoosenVideoSoure.Start();
ChoosenVideoSoure.Start();
}
private void stop_Click(object sender, EventArgs e)
{
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
if (ChoosenVideoSoure != null)
{
if (ChoosenVideoSoure.IsRunning)
{
ChoosenVideoSoure.Stop();
pictureBox1.Image = null;
}
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (ChoosenVideoSoure != null)
{
if (ChoosenVideoSoure.IsRunning)
{
ChoosenVideoSoure.Stop();
pictureBox1.Image = null;
}
}
}
private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap img = (Bitmap)eventArgs.Frame.Clone();
pictureBox1.Image = img;
}
//close the device safely
private void CloseVideoSource()
{
if (ChoosenVideoSoure != null)
{
if (ChoosenVideoSoure.IsRunning)
{
ChoosenVideoSoure.Stop();
pictureBox1.Image = null;
}
}
}
private void record_Click(object sender, EventArgs e)
{
}
}
}
* Let's say this is the code, so how can i add the record_click part to make it what i want??
I really appreciate for your kindly help :) thanks alot & alot...
Su GeokPosted Feb 26, 2010, 4:47 AM