question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenCV/Numpy example not working correctly on macOS

See original GitHub issue

Hi, First of all, thank for a great library. I encountered some issues while trying to record my screen.

General informations:

  • MSS version: 3.0.1
  • OS name: macOS Sierra
  • OS version: 10.12.5 (16F73)
  • OS architecture: 64 bits
  • Result of the command python --version: Python 3.5.3
  • OpenCV version: opencv3 : 3.1.0
  • Numpy Version: 1.12.1

Description of the warning/error

I tried out OpenCV/Numpy example to record the screen. But the frames are getting delayed with time(exponentially), I think there are lots of GC happening. I interrupted the command line after fps: 0.07140145917730202 because the display window was not responding. Ways to reproduce: It is happening every time.

Full message

Rohits-MacBook-Pro:drive rohitarya$ python3 readscreen.py 
fps: 4.144634697781783
fps: 1.2977357482958785
fps: 0.3543577094166482
fps: 0.07140145917730202
^Cpython3(19339,0x7fffe9aae3c0) malloc: *** mach_vm_map(size=8404176896) failed (error code=4)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
python3(19339,0x7fffe9aae3c0) malloc: *** mach_vm_map(size=8404176896) failed (error code=4)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
python3(19339,0x7fffe9aae3c0) malloc: *** mach_vm_map(size=8404176896) failed (error code=4)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
python3(19339,0x7fffe9aae3c0) malloc: *** mach_vm_map(size=8404176896) failed (error code=4)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
python3(19339,0x7fffe9aae3c0) malloc: *** mach_vm_map(size=8404176896) failed (error code=4)
*** error: can't allocate region

Other Information

Rest of the examples(Part of the screen, PIL, Playing with pixels) are working perfectly fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
arpit-kallacommented, Jul 13, 2017

Kindof solved the issue by putting the monitor = {'top': 40, 'left': 0, 'width': 100, 'height': 100} line inside the loop. Dont know why this exactly works but I assume the monitor values are getting updated by mistake in the grab function

0reactions
BoboTiGcommented, Jul 30, 2017

Hello, could you try with the latest version in the dev branch please? I removed the border effect with monitor’s width.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving macOS, OpenCV, and Homebrew install errors
Are you running into problems install OpenCV via Homebrew? Let me help. Inside this tutorial I discuss OpenCV + Homebrew errors and how...
Read more >
OpenCV does not work after installing it on my macOS. Can ...
I installed OpenCV through Homebrew on my system and installed the opencv-python module through pip . My code: import cv2 img = cv2.imread(" ......
Read more >
Can't import numpy properly on mac os · Issue #13398 - GitHub
I cannot import numpy. I installed and reinstalled it a few times using pip install --upgrade --force-reinstall numpy but nothing works.
Read more >
How to Install OpenCV on Mac OS with PYTHON - YouTube
How to Install OpenCV on Mac OS with PYTHON This is a step-by-step tutorial on how to install OpenCV for your Mac computer....
Read more >
How to Install Opencv 4 on MacOS? - GeeksforGeeks
Step 2: Check if pip3 and python3 are correctly installed. ... Step 3: Upgrade your pip to avoid errors during installation. ... Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found