CvInvoke.VideoWriter videoWriter = new CvInvoke.VideoWriter("output.avi", CvInvoke.CV_FOURCC('M','J','P','G'), 30, new Size(640, 480), true);
CvInvoke.VideoCapture videoCapture = new CvInvoke.VideoCapture("input.avi"); if (videoCapture.IsOpened) { Mat frame = new Mat(); while (videoCapture.Read(frame)) { //process the frame } videoCapture.Release(); }In this example, we create a video capture object from the input video file "input.avi". We check if the video capture object is successfully opened, then read frames from the video, process each frame, and release the video capture when processing is done. Both examples use the CvInvoke namespace, which is part of the Emgu CV library.