opencv获取编码fourcc

来源:互联网 发布:985软件工程硕士工资 编辑:程序博客网 时间:2024/06/07 21:58
#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;}

原创粉丝点击