Qt或OpenCV:打印视频文件的编解码器
我想知道如何在使用VideoCapture(在OSX或Ubuntu上)打开视频文件后打印出视频文件的编解码器 该文件由opencv在qt应用程序中正确加载和可视化Qt或OpenCV:打印视频文件的编解码器,qt,opencv,codec,Qt,Opencv,Codec,我想知道如何在使用VideoCapture(在OSX或Ubuntu上)打开视频文件后打印出视频文件的编解码器 该文件由opencv在qt应用程序中正确加载和可视化 QString filename = QFileDialog::getOpenFileName(...) cout << filename.size() << endl; // size in byte VideoCapture cap = VideoCapture(filename.toStdString(
QString filename = QFileDialog::getOpenFileName(...)
cout << filename.size() << endl; // size in byte
VideoCapture cap = VideoCapture(filename.toStdString());
cout << cap.get(CV_CAP_PROP_FRAME_HEIGHT) << endl; // print the height
cout << cap.get(CV_CAP_PROP_FPS) << endl; // print the fps
codec ??
QString filename=QFileDialog::getOpenFileName(…)
试试看
获取编解码器
编辑:
我不是C++程序员,但我发现这是我搜索到的字符数组:
int ex = static_cast<int>(inputVideo.get(CV_CAP_PROP_FOURCC));
char EXT[] = {ex & 0XFF , (ex & 0XFF00) >> 8,(ex & 0XFF0000) >> 16,(ex & 0XFF000000) >> 24, 0};
intex=static_cast(inputVideo.get(CV_CAP_PROP_FOURCC));
字符EXT[]={ex&0XFF,(ex&0XFF00)>>8,(ex&0XFF0000)>>16,(ex&0XFF000000)>>24,0};
见:
试试看
获取编解码器
编辑:
我不是C++程序员,但我发现这是我搜索到的字符数组:
int ex = static_cast<int>(inputVideo.get(CV_CAP_PROP_FOURCC));
char EXT[] = {ex & 0XFF , (ex & 0XFF00) >> 8,(ex & 0XFF0000) >> 16,(ex & 0XFF000000) >> 24, 0};
intex=static_cast(inputVideo.get(CV_CAP_PROP_FOURCC));
字符EXT[]={ex&0XFF,(ex&0XFF00)>>8,(ex&0XFF0000)>>16,(ex&0XFF000000)>>24,0};
见: