用opencv查看视频信息(视频的宽度、高度、帧率和总得帧数)
// look_up_fps.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <cv.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *nFrames = NULL;
CvCapture* pCapture = NULL;
if( !(pCapture = cvCaptureFromAVI("C:\zcd.avi")))
{
fprintf(stderr, "Can not open camera.n");
return -1;
}
int frameH = (int) cvGetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_HEIGHT);
int frameW = (int) cvGetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_WIDTH);
int fps = (int) cvGetCaptureProperty(pCapture, CV_CAP_PROP_FPS);
int numFrames = (int) cvGetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_COUNT);
printf("vedio's nwidth = %dt height = %dn video's fps = %dt nums = %d", frameW, frameH, fps, numFrames);
getchar();
return 0;
}
最后
以上就是称心香水最近收集整理的关于用opencv查看视频信息(视频的宽度、高度、帧率和总得帧数)的全部内容,更多相关用opencv查看视频信息(视频内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复