Support CV_CAP_MODE_GRAY in FFMPEG backend#9123
Support CV_CAP_MODE_GRAY in FFMPEG backend#9123cristiklein wants to merge 3 commits intoopencv:3.4from
Conversation
|
@alalek 👍 |
|
you should rather use |
|
Thanks @paroj for your feedback. I went through #5458 and I am confused. The proposal mentions Also, I looked at Can you clarify how I should proceed? |
|
yes,
|
|
Thank you for the clarification. Let me give you my opinion about your suggestion:
Do you feel there are other good options except |
|
unfortunately there is no backend neutral property to achieve this right now. That is exactly why You could let |
|
@cristiklein, thanks for the contribution! I do not see how the newly added FFMPEG enum values (which are declared in the internal header) relate to the public API. It's quite unsafe solution because we can easily end up with unsynchronized values and then we get very weird results or crashes |
|
@vpisarev, I couldn't agree more! However, if you look at the FFMPEG enum values, they are all unrelated to the public API and can easily end up unsynchronised. Hence, I simply opted for maintaining the existing "style" hoping that that would make my patch more acceptable. I think we both agree that a proper solution would entail making all FFMPEG enum values relate to their public counterpart. |
|
I believe because standalone ffmpeg wrapper can't use OpenCV's public API headers without additional refactoring (split enums from others things). |
4280d76 to
664d089
Compare
|
jenkins cn please retry a build |
This pullrequest changes
This pullrequests adds support for
CV_CAP_MODE_GRAYin the FFMPEG videoio backend. This is particularly beneficial for applications that only care about the luminance, such as feature detection. Without this features wasteful conversion might happen, e.g., FFMPEG backend converts video from YUV to RGB then application usescvtColorto convert frame to gray, although this information is already available in the Y channel.