An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
Questions tagged [python-mss]
77 questions
0
votes
1 answer
How to increase the fps of screen recorder in cv2
I have written a code to record the screen recorder using python but when i see the output then i found that its fps is very low .Is there any better code than mine to increase the fps of the screen recorder.
If yes then please reply.
Here is mine…

code by Abhishek Bharti
- 252
- 2
- 13
0
votes
1 answer
Threading and mss problem - error when running function for the second time
I can't figure out, how to make it work. I hope you will help me.
I edited the code, to make it more simple and short - that's why it's only printing something out, but it's enough to show the issue.
Everything is running fine, as long as I hit the…

Dawid Rutkowski
- 410
- 3
- 8
0
votes
4 answers
cv2.cvtColor(img,cv2.COLOR_BGR2RGB) not working
I am trying to create a screen recorder using mss and Opencv in python, the video I am capturing has a very different colours than original computer screen. I tried to find the solution online, Everyone saying it should be fixed using cvtColor() but…

Pramod Pardeshi
- 98
- 1
- 1
- 9
0
votes
1 answer
Using mss with multithreading in python gives an error
I am using mss module in python to take screenshots of the whole screen. I have split the screen into separate blocks and I am taking screenshots of those specific blocks. Doing this in a loop takes so long and the time increases as the amount of…

NewbieCoder
- 105
- 9
0
votes
1 answer
Python MSS for Python3.4
Iam developing a software to record screen, and currently using the screenshot module from mss package.
But i need that software to work with python 3.4 and cant find a suitable version from mss lib, does someone know how to install that package on…

AndreHermann
- 3
- 2
0
votes
2 answers
Getting TypeError: Expected cv::UMat for argument 'src' while casting bgr to rgb
I wanna cast bgr to rgb, but I'm getting "TypeError: Expected cv::UMat for argument 'src'" error
pip freeze:
greenlet==0.4.15
msgpack==0.6.1
mss==4.0.3
numpy==1.17.0
opencv-python==4.1.0.25
Pillow==6.1.0
pywin32==224
import numpy as np
import…

Friedrich42
- 752
- 4
- 10
0
votes
0 answers
MSS performance issue
According to this answer, mss is supposed to be very fast, but there no more a mss.mss.get_pixels() method and mss.mss.grab() is giving me poor results (0.074s on 1440p screen for grab()). I get pretty much same results the most of the time using…

Valink
- 1
- 2
0
votes
2 answers
MSS, Python: Maximum number of clients reachedSegmentation fault (core dumped)
I use MSS for Python for capturing screenshots rapidly on my computer, but when putting the image capturing inside a while loop:
import mss
while True:
sct = mss.mss()
I get an error message Maximum number of clients reachedSegmentation fault…

Andreas Forslöw
- 2,220
- 23
- 32
0
votes
1 answer
When taking many screenshots with MSS, memory fills quickly and crashes python
Here's my code:
import time
import cv2
import mss
import numpy as np
Frame = [0, 0, 1920, 1080]
def GetFrame():
monitor = {"top": Frame[0], "left": Frame[1], "width": Frame[2], "height": Frame[3]}
sct_img = mss.mss().grab(monitor)
…

Gaberocksall
- 359
- 2
- 13
0
votes
1 answer
Error feeding numpy array d.type uint8 into adaptivethreshold function
I'm trying to feed a numpy array into the Process_img (adaptivethreshold) function. The numpy array has a data type of uint8 and 3 dimensions, which should be accepted by the function.
I am getting the following error message. I've tried converting…

Mogarbobac
- 97
- 2
- 10
0
votes
1 answer
Python MSS - make screenshot filesize smaller or in jpg?
Depending on what is shown on the monitor, the screenshot of Python MSS can go up to 2 MB even though I have the compression set to the maximum which is 9. Is there another way to reduce the filesize or to save it instead as a jpg which would be…

Zurd
- 686
- 7
- 16
0
votes
1 answer
Arkham Origins with Python?
Okay, so today I got nostalgic and started to play Arkham Origns. I get to this part where Deathstroke hands me my butt all the while mocking me, so I try again. But nope, couldn't counter his attacks in time. Apparently, my timing wasn't accurate.…

pinkpanta
- 11
- 3
0
votes
1 answer
Can’t get darkflow to process screenshots in realtime
I tried to create a simple program which captures screenshots (using mss) and gets tensorflow to predict/detect elements in the images, but it's not working. Here's part of the code:
import cv2
import mss
import numpy as np
from PIL import…

Legion
- 454
- 2
- 7
- 17
0
votes
1 answer
python screen-print does not capture drop-down menu on all windows applications
I have tested three different methods for capturing a windows screen containing a drop down menu. Neither method captures the drop-down menu. Could anybody explain to me how this could be achieved?
The image to be captured:
The resulting image…

Bill Bridge
- 821
- 1
- 9
- 30
0
votes
2 answers
Convert CGImageRef to PIL
How could I convert a CGImageRef to PIL without saving the image to disk on osx?
I though about getting the raw pixel data from the CGImageRef and using Image.fromstring() to make the PIL image by doing
import mss
import Quartz.CoreGraphics as…

nom3kop
- 1
- 3