OpenCV 3.1 VideoWriter::write(const Mat&) does not return its status.
Hello, I found it strange that the "VideoWriter::write(const Mat&)" function does not return its status (true/false).
I think that function should return an int to inform about the result of the call. (true (success) / false (fail))
The function declaration could be changed to: "virtual int write (const Mat &image)" instead of "virtual void write (const Mat &image)"
It would be easy to return the status because the source code inside write is using "cvWriteFrame(writer, &_img);" which returns an integer.
See definition and source here:
http://docs.opencv.org/master/dd/d9e/...
https://github.com/opencv/opencv/blob...
void VideoWriter::write(const Mat& image)
{
if( iwriter )
iwriter->write(image);
else
{
IplImage _img = image;
cvWriteFrame(writer, &_img);
}
}
Otherwise, how can we know the status of the write call ?
(For example: it could fail because of the drive is full or there is a problem with the encoder or the storage device has been removed)
If my comment is relevant, where should I request that change ?
Thanks
I believe that if the write fails, it will issue an exception that can be caught.
I tried it and there is no exception. Also errno is not set. I think the definition of the function should be changed...
I will write a message on the mailing list..
You are trying to catch
cv::Exception
. Right?