<< Video reading | Video reading | VideoCapture_isOpened >>

scicv >> Video > Video reading > VideoCapture

# VideoCapture

Class for video capturing (from a capturing device, or a video file).

### Description

`VideoCapture` is the class to read video files, capture video from devices.

A `VideoCapture` object is constructed with new_VideoCapture. The instance returned is used as argument of each of the `VideoCapture` functions, such as VideoCapture_read, etc. A `VideoCapture` object must be deleted with delete_VideoCapture.

### Examples

    scicv_Init();

    videoCapture = new_VideoCapture(getSampleVideo("video.mpg"));
    startWindowThread();
    namedWindow("video.mpg");

    while %t
        [ret, frame] = VideoCapture_read(videoCapture);
        if ret then
            imshow("video.mpg", frame);
            if waitKey(40) <> -1 then
                break;
            end
            delete_Mat(frame);
        else
            break
        end
    end

    destroyWindow("video.mpg");
    delete_VideoCapture(videoCapture);

### See also

- new_VideoCapture
- VideoCapture_isOpened
- VideoCapture_read
- delete_VideoCapture

Report an issue
<< Video reading | Video reading | VideoCapture_isOpened >>