Skip to content

fix #17687 MSMF slow webcam startup#20327

Merged
alalek merged 2 commits intoopencv:masterfrom
tibaes:MSMF-Slow-Webcam-Startup
Jun 30, 2021
Merged

fix #17687 MSMF slow webcam startup#20327
alalek merged 2 commits intoopencv:masterfrom
tibaes:MSMF-Slow-Webcam-Startup

Conversation

@tibaes
Copy link
Copy Markdown
Contributor

@tibaes tibaes commented Jun 29, 2021

resolves #17687

Fix issue #17687 using @ercarpio suggestion to set MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS to false.
Without this fix, some webcams take a few minutes to startup using MSMF on Windows, whereas it should be instantaneous.
My webcam was having this delay issue and it solved for me as well. From my experiments there were no drawbacks so far.
Would appreciate more testing on this with broader range of webcams as I don't have many to test by myself.
Kindly request @mshabunin for review, as he asked this pull request.

Pull Request Readiness Checklist

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

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@tibaes tibaes requested a review from alalek June 30, 2021 18:10
@tibaes
Copy link
Copy Markdown
Contributor Author

tibaes commented Jun 30, 2021

@alalek, I used the name OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS for better readability, hope that's okay.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you for contribution 👍

@alalek alalek merged commit bf489fe into opencv:master Jun 30, 2021
@yesido448
Copy link
Copy Markdown

I have the same issue above link on emgucv 4.5.3.4721
There Is solution on opencv and what about emgucv?
Is there any way to solve this issue on emgucv?

Is there any way to set "OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS" in C# while using emgucv ?
Environment.SetEnvironmentVariable?

@alalek alalek mentioned this pull request Oct 15, 2021
@LaurentBerger LaurentBerger mentioned this pull request Mar 17, 2023
6 tasks
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
* fixes MSMF slow webcam startup

* add variable to change MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS at runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camera is very slow to open when using the MSMF VideoCapture backend

3 participants