I use VideoWriter::write
to wrote a Mat
with the pixel format of CV_32FC3
,but it would always cause an error when VideoWriter::write
was called.
Then i found that any pixel format of CV_8UC*
would always succeed.
But Why?
Error Msg Was:
OpenCV(4.2.0) Error: Assertion failed (!fixedType() || ((Mat*)obj)->type() == mtype) in cv::debug_build_guard::_OutputArray::create, file C:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\matrix_wrap.cpp, line 1195
Any answer will be helpful
Asked
Active
Viewed 275 times
0

Suric
- 53
- 1
- 10
-
What format video file were you hoping to store your 96-bit video in? I mean which file extension were you expecting it to have? – Mark Setchell Mar 08 '20 at 11:49
-
@MarkSetchell i use mp4 as file extension.and do you mean that mp4 doesn't support it or something? – Suric Mar 08 '20 at 12:02
-
1Correct, video is simply not stored at such high colour depths. – Mark Setchell Mar 08 '20 at 12:10
-
@MarkSetchell I got it, thank you very much – Suric Mar 08 '20 at 12:20
-
Since OpenCV 4.7.0 it is possible to write `CV_16UC1` videos, see https://stackoverflow.com/a/76509662 – Marcono1234 Jun 19 '23 at 19:48