1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #29087 from abhishek-gola:videoio_write_issue_fix

Fixed write return status in videoio module#29087

closes: https://github.com/opencv/opencv/issues/24287

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Abhishek Gola
2026-05-25 00:40:00 +05:30
committed by GitHub
parent ac1ed5c160
commit f539c0907e
16 changed files with 93 additions and 44 deletions
+19
View File
@@ -137,6 +137,25 @@ TEST(videoio_images, bad)
}
}
TEST(videoio_images, write_returns_status)
{
ImageCollection col;
col.generate(1);
VideoWriter wri(col.getFirstFilename(), CAP_IMAGES, 0, 0, col.getFrame(0).size());
ASSERT_TRUE(wri.isOpened());
const Mat frame = col.getFrame(0);
EXPECT_TRUE(wri.write(frame));
wri.release();
ASSERT_FALSE(wri.isOpened());
EXPECT_FALSE(wri.write(frame));
VideoWriter empty;
EXPECT_FALSE(empty.isOpened());
EXPECT_FALSE(empty.write(frame));
}
TEST(videoio_images, seek)
{
// check files: test0005.png, ..., test0024.png