- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
AVFoundation support for macOS #7159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Support setting CAP_PROP_MODE to capture grayscale or YUV frames much faster from CV_CAP_AVFOUNDATION_MAC.
CvVideoWriter_AVFoundation_Mac had a serious buffer release bug. Also made writeFrame() block until isReadyForMoreMediaData rather than return an error.
@rgov, thank you for cleaning these patches up. I will review and re-test to confirm everything. |
Ping. |
OK, I reviewed and all of the changes appear to be in correctly. LGTM! |
Can we get this fix into the main fork? So that I can begin using OpenCV on macOS Sierra again? Thanks! |
What is the expected behavior of For example, if you open a There is no way to reliably know the timestamp of the next frame, so it makes sense to return the actual timestamp of the previous frame. Should we make the frame numbers behave the same way? Should callers use If so, should (I'm assuming here that frame numbers are zero-based on OpenCV, but I don't see that documented clearly anywhere.) Currently my app uses a hacky |
@mself Are these (perfectly valid) open questions blocking acceptance of this pull request? If not, how do we get this merged in first? |
@rgov Sorry, no, I don't think my question should in any way hold up merging this PR. I'm using this code in my app today and it works fine. It seems like there is a lot of demand for getting this merged. |
So is this merged yet? Thanks |
Is there any doc, sample, snippet or tutorial for AVFoundation for macOS ? |
Here's a simple example:
|
it would be nice to see anything in the official docs ;) maybe here ? |
I think timestamp of But, @mself says:
This is true. |
I really regret upgrading my machines to Sierra as a result of this issue. Is there any way to get a working branch (even if sub-optimal) and work on long-term solutions with additional PRs? |
This branch works fine. I am using it on Sierra for all of my projects. The discussion about how I also strongly support merging this PR. |
@mself: Strange, NM. Compiled the branch on CLion on the same box and it compiles fine. Thanks for your effort on the fork and trying to get it merged! |
With XCode 8 released QTKit support is now also gone on El Capitan. So AVF support is now really important. |
I don't mean to beat a dead horse, but install is currently impossible on Sierra due to QTKit removal. Any update would be very much appreciated. |
Please check whether #7266 (based on this PR) resolves the issue. |
Merged, great job! How long until this appears downstream in |
+1 @marcusguttenplan: Have you ever sent a PR to |
@briantopping I have not! I assume it's just a matter of updating the branch and adding a new checksum for Sierra in homebrew-science? I don't want to break anything though. |
That’s correct. You what to expect from the software and there are hundreds of packages being upgraded all the time. If it works for you, it works better than what is there now. :-) Go for it! |
Depending on how often OpenCV pushes changes from the master branch to the stable 2.4 branch, it should start appearing in homebrew tomorrow. I'm weary of changing the branch in the brew formula to the master in case of future breakage, and there's already a checksum for Sierra. Looks like I've just got to wait giddily! |
This patch should be available now in the |
Thanks! Does anyone know if this fix is also available for OpenCV 2.4? |
@jordimares There is backport of this patch into 2.4 branch: #7314. Could you take a look? |
@alalek Thanks for this. Any idea when can it be merged so I can install it in my macOS Sierra? |
same here for macports ... |
For any other macports users who come across this bug report, this is how I got installation to work with video disabled (which is good enough for me):
|
That worked for me. Thanx, you are my weekend-hero! |
### 문제점 - 애플이 sierra에서 qtkit 없애버림 - opencv/opencv#7159 에서 수정됐지만 아직 정식으로 배포되진 않았음 ### 수정 사항 - mac os x일 때는 최신 버전 opencv를 빌드하도록 수정함
Since opencv/opencv#7159, opencv and opencv3 use AVFoundation instead of quicktime. The same change as in this commit was done for the opencv formula, so this brings both opencv and opencv3 in line. The AVFoundation is ON by default on mac, so video capabilities are still guaranteed.
Since opencv/opencv#7159, opencv and opencv3 use AVFoundation instead of quicktime. The same change as in this commit was done for the opencv formula, so this brings both opencv and opencv3 in line. The AVFoundation is ON by default on mac, so video capabilities are still guaranteed.
resolves #4930
resolves #6913
I did not write these patches, but I've rebased them onto
master
and tested that they work. I squashed commits related to whitespace issues.The work was originally done by @mself and @yoffy in #6678, which was closed and re-opened as #6802 by @vpisarev, who also opened #6826 with a subset of the original patches. That one now does not merge cleanly. Then GitHub seemed to lose some of the history (maybe someone deleted their fork?) and it was a little painful to reconstruct the patches by copying and pasting from the web UI.