I wish to Record a Webcam, which is being as a mpjeg streamer
Am using
Emgu 4.7.0.5276
Emgu.CV.Bitmap 4.7.0.5276
DirectShowLib to select Webcam
```
public void SetupWebCam()
{
recording = false;
if (capture != null) capture.Dispose();
capture = new VideoCapture(deviceID);
writer = new VideoWriter("0video.mp4", VideoWriter.Fourcc('H', '2', '6', '4'), 30, new Size(1920, 1080), true);
capture.Start();
//get frames
capture.ImageGrabbed += Capture_ImageGrabbed;
}
private void Capture_ImageGrabbed(object sender, EventArgs e)
{
frame = new Mat();
capture.Retrieve(frame);
pictureBox1.Image = frame.ToBitmap();
if (recording == true)
{
writer.Write(frame);
}
}
Buttons to set recording true or false
It works, but **0Video.mp4** is Zero bytes
thanks