I am trying to record a video captured from a webcam using Emgu CV, but I am getting an exception.
_capture = new Capture(0);
_capture.QueryFrame();
captureOutput = new VideoWriter(@"output.avi",
(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FOURCC),
(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FPS),
(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH),
(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT),
true);
Image<Bgr, Byte> frame = _capture.QueryFrame();
captureOutput.WriteFrame(frame);
I get "Attempt to divide by zero." an exception when I execute the line captureOutput.WriteFrame (frame).
source
share