[英]Assertion error when encoding video using ffmpeg library on visual studio c++
[英]Error playing video when using OpenCV C++ on a Visual Studio platform
我試圖讓它運行,但它沒有做任何事情,沒有顯示錯誤並自動終止了程序。
#include"opencv2/core/core.hpp"
#include"opencv2/highgui/highgui.hpp"
#include"opencv2/imgproc/imgproc.hpp"
#include<stdio.h>
int main(int argc, char* argv)
{
cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("C:/Users/Nam/Pictures/YALQ6371.MP4");
IplImage* frame;
while (1){
frame = cvQueryFrame(capture);
if (!frame) break;
cvShowImage("Example2", frame);
char c = cvWaitKey(33);
if (c == 27) break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Example2");
return 0;
}
嘗試使用imshow
而不是cvShowImage
,但不要忘記添加using namespace cv;
一開始。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.