C++
1#include <iostream> 2#include <opencv2\opencv.hpp> 3 4using namespace std; 5using namespace cv; 6 7int main() { 8 string file_name = "研究用動画"; 9 VideoCapture capture = VideoCapture(file_name + ".mp4"); 10 int max_frame = capture.get(CV_CAP_PROP_FRAME_COUNT); 11 VideoWriter writer("編集済み研究用動画.avi", CV_FOURCC_DEFAULT, 25, cv::Size(480, 640), true); 12 13 // エラー処理 14 if (!writer.isOpened()) { 15 cerr << "Could not open the output video file for write\n"; 16 return -1; 17 } 18 19 20 for (int i = 0; i<max_frame - 1; i++) { 21 // 現在のフレームを保存 22 Mat curr; 23 capture >> curr; 24 //書き出し 25 writer << curr; 26 27 imshow("nakanome", curr); 28 29 waitKey(1); 30 } 31 32 return 0; 33}
開発環境
Visual Studio 2015, C++, OpenCV3.1, windows10
上みたいな感じで6kしか情報がなく再生できない
情報としてはこんな感じです。
不足してるものがあればぜひ指摘して下さい。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー