how to grabbe a video in HD in opencv

asked 2013-01-14 02:08:37 -0500

engine gravatar image

I'm trying to record a video with OpenCV the frame is 1920*180 with 25 frame/s, my Problem is that when I chose to write the frame uncompressed I don't get a video I get only one picture in avi format!! here my code :

  using namespace cv;

 int main (){
int key = 0;
Mat frame;
cv::VideoCapture cap(0);
cap>>frame;
cv::VideoWriter record("video.avi",-1, 25, frame.size(), true);
    while(key!=27){
cap>>frame;
//cv::VideoWriter record("video.avi",-1, 25, frame.size(), true);

record<<frame;
imshow("",frame);
key=waitKey(1);
}

frame.release(); cv::destroyAllWindows();

return 0 ;

}

I'm use DeckLink SDI card to get the video, and when record the video with Media Express it works ? any Idea

edit retag flag offensive close merge delete