您的位置:首页 > 运维架构

opencv获取编码fourcc

2017-08-18 17:47 302 查看
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
cv::VideoCapture cap(0);
unsigned int f = (unsigned)cap.get(cv::CAP_PROP_FOURCC);
char fourcc[] = {
(char)f, // First character is lowest bits
(char)(f >> 8), // Next character is bits 8-15
(char)(f >> 16), // Next character is bits 16-23
(char)(f >> 24), // Last character is bits 24-31
'\0' // and don't forget to terminate
};
cout << "FourCC for this video was: " << fourcc << endl;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: