[Learn OpenCV Introduction] [004] [Play AVI Video]

Source: Internet
Author: User

Cvcreatefilecapture (file path)

Create a video recorder with a return value of cvcapture type for reading

Cvquerframe (VIDEO)

The next frame video file is loaded into memory, and when Cvcapture is released, the corresponding memory of each frame is freed, so Cvreleaseimage (&frame) is not required;

Cvreleasecapture (VIDEO)

Frees the memory space of the cvcapture result, and also closes all open video file related handles.

#include "highgui.h" int main (int argc, char** argv) {char c;iplimage* frame; cvcapture* Capture;cvnamedwindow ("Hello", cv_window_autosize); capture = Cvcreatefilecapture (argv[1]); while (1) { frame = Cvqueryframe (capture); if (!frame) {break;} Cvshowimage ("Hello", frame), C = Cvwaitkey (), if (c = =) {   //escbreak;}} Cvreleaseimage (&frame);   Adding this sentence will result in an error: Segment error (Core dump) cvreleasecapture (&capture), Cvdestroywindow ("Hello"); return 0;}

[Learn OpenCV Introduction] [004] [Play AVI Video]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.