The resulting file is reported as codec: FFV1, ColorSpace: Y, BitDepth/String: 16 by MediaInfo so I think it looks ok. And the images I use to create the video are truly 16 bit png files. I can load them into OpenCV (IMREAD_ANYDEPTH)) and read their 16-bit value.
Now, I am trying to read the video sequence with videocapture:
which gives me an 8UC3 image that can be shown, but the precision is lost (only 8 upper bits remain).
If I try for example
videoD.open("output_ffv1.avi", CAP_DSHOW);
then I get a 16UC1 image, but it is filled with a constant value of 52685.
How can I get the real 16-bit value from the video? I am using Windows 10 and OpenCV 4.4.0 and C++. I think I did not compile it with OpenNI support, but since I am not connecting a device i doubt it matters.
Any advice will be appreciated.
always returns 0, regardless if I set it to false or true. Do you think it might work with the latest OpenCV build (I am using 4.4.0)?
EDIT:
I did compile the latest master branch, but it did not help
look for “convertRGB”. there isn’t much going on, and what is going on, is conditional on a few things that might not hold true in your case.
you’ll note the latest change is 8 days ago and is related to this feature.
and there are a bunch of open issues mentioning the cap prop flag.
that means you can’t expect this to work yet. if you have trouble, consider adding your voice to an appropriate issue on github, or create one if you found a new problem.