incorrect video after VideoWriter if is_color == false (Bug #1615)
Description
Sample:
1 VideoCapture cap(argv[1]);
2
3 if (!cap.isOpened())
4 return 1;
5
6 Ptr<VideoWriter> vw = 0;
7
8 while(true)
9 {
10 Mat frame;
11 cap>>frame;
12 if (frame.empty())
13 break;
14
15 if (!vw)
16 {
17 vw = new VideoWriter(argv[2], CV_FOURCC('P','I','M','1'), 25, frame.size(), false);
18 if (!vw->isOpened())
19 break;
20 }
21
22 Mat gray;
23 cvtColor(frame, gray, CV_BGR2GRAY);
24
25 *vw << gray;
26
27 imshow("gray", gray);
28 waitKey(1);
29 }
30 vw->~VideoWriter();
Associated revisions
fixed #1615
History
Updated by Alexander Shishkov about 13 years ago
- Status deleted (
Open)
Updated by Alexander Shishkov about 13 years ago
- Status set to Done
Updated by Andrey Kamaev about 13 years ago
- Description changed from Sample: <pre> VideoCapture cap(argv[1]); if (!cap.isOpened()) ... to Sample: <pre><code class="cpp"> VideoCapture cap(ar... More
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-video