opencv:4.x
← mshabunin:ffmpeg-16bit
opened 10:58PM - 30 Nov 22 UTC
Partially resolves #10623
Replaces #12284 and #12290
* _VideoCapture_: we ca…n now disable BGR conversion using parameter for the FFmpeg backend and return image in original format, straight from decoder. However this feature has many limitations, for example it is not possible to return multiplanar images yet - new interface or additional processing is necessary for this. So I added a warning with some details which will be printed when this feature is enabled. Basically 8UC1 and 16UC1 can now be returned from _VideoCapture_ in addition to BGR.
* _VideoWriter_: we can set depth using parameter during object initialization. It can be 8U or 16U. In combination with _isColor_ it gives us three supported formats: 8UC3, 8UC1 and 16UC1; and one unsupported: 16UC3. 16UC1 can be handled by the `FFV1` codec.
* Several debug and warning log messages have been added for convenience and safety
* The new test writes a video and then reads it back, frames are not compared with the original, only format and count is verified. Unsupported format combination is also checked in this test which is not very good, but I believe is fine for now.
* FFV1 codec/container has been added to generic ffmpeg and videoio tests (regular BGR)
Note: some other codecs had _hidden_ support for 16UC1, but I did not test them (PNG and RAWVIDEO).
Note: originally I wanted to modify #12290 - add a test, fix minor issues, but it turned out that I had to rewrite 90% of changes made in that PR, so I decided to publish it as a brand new one.
```
buildworker:Custom=linux-4
build_image:Custom=ffmpeg-master
```