Questions tagged [python-mss]
An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
62
questions
0
votes
1
answer
27
views
python-mss speedup grab until 60fps
I have this simple multiprocessing script which:
I define grabber process with using mss module to get screenshot
I define displayer process with using pygame module to display current screenshot (...
1
vote
0
answers
55
views
Python: Tkinter + MSS = mss.exception.ScreenShotError: XDefaultRootWindow() failed
I am facing a pretty strange behavior of Python MSS library when using inside Tkinter GUI.
I have a Tkinter window that has a button for popping up a TopLevel window. Inside that TopLevel window, I ...
0
votes
1
answer
167
views
Can I get the screenshot data as a file-like object or the image in bytes without saving any file?
I want to send a screenshot over a discord webhook. I am using the dhooks module for this. To send a file, I need a "file-like object" so I want to get a file-like object without having the ...
0
votes
0
answers
103
views
How to use Python TesserOCR API with MSS to Read Real-Time Text
Previously, I've been using Pytesseract, but for efficiency and performance, the TesserOCR API seems to be a better option for me. However, there seem to be some issues with reading the text in real-...
1
vote
1
answer
2k
views
Python MSS Screen Capture target specific windows
Is there any way to screencapture specific windows from windows handle? Even the windows is in the background it still will capture it. currently i only have this code for record the fullscreen ...
0
votes
1
answer
285
views
Can't seem to properly run python MSS library
I am trying to learn the MSS python library to stream/reflect what's in the monitor. My intention is to use it with OpenCV to process the image. I got this source code from a youtube tutorial but I am ...
0
votes
0
answers
173
views
How to extract word from screen using pytesseract
I'm trying to extract word from the screen using pytesseract.
the word is white and the background of it is in other colors.
screenshot image
the word of the screenshot is always white but background ...
0
votes
1
answer
442
views
Python-mss error: Impossible to take screenshot on regions with grab()
I am trying to use mss and opencv to find images on the screen. However, whenever I try to use regions with mss I get this error:
It seems this issue is related to some ressources not being freed: ...
0
votes
0
answers
222
views
Rtsp stream python mss screen captures using gstreamer
No Stream content when view from rtsp player.
I have captured screen using python mss,
converted to opencv frame and trying to live stream using gstreamer
ffplay rtsp://127.0.0.1:8554/test doesnot ...
0
votes
0
answers
285
views
ValueError: String length does not equal format and resolution size
I need help I have attempted to implement the following code into my current project: Screen sharing in python However the client returns ValueError:String length does not equal format and resolution ...
1
vote
1
answer
5k
views
How to read text directly from screen using python [duplicate]
I want to build project that reads texts continuously from part of my pc screen and shows them on the console of pycharm
I am using python 3, all modules are installed using pip from pycharm console....
0
votes
1
answer
79
views
Capturing screen of another windows user with python-mss
I'm working on screen capture on Windows using Python and mss, and I'm wondering if I can capture the screen of another user on the same machine.
I have two windows users on the machine: one running a ...
0
votes
0
answers
279
views
How can I effectively compress a frame in memory?
I'm testing out screen-casting in Python. The code for both the client and server is relatively simple.
In sum, what I was previously doing was:
On the server:
Grabbing screen with mss
Serializing ...
0
votes
1
answer
1k
views
How to record my computer screen with high FPS?
I'm trying to add a high FPS screen recorder to my application.
I use Python 3.7 on Windows.
The modules and methods I've tried are mss (python-mss) and d3dshot, but I'm still only achieving 15-19 FPS ...
1
vote
0
answers
82
views
Get capture from fullscreen
I'm trying to make a "video" of my screen, so that the opencv can analyze it, and so far it works well, however when I go into full screen mode, the program stops recording or analyzing, ...
1
vote
1
answer
5k
views
TypeError: Expected Ptr<cv::UMat> for argument 'mat' using mss library in python
I am trying to screenshot using mss library add display it using below code but getting same error every time.
Is there a fix for this error
TypeError: Expected Ptr<cv::UMat> for argument 'mat'
...
0
votes
1
answer
393
views
Faster screen capture [closed]
Is it possible to capture the screen in gray? Will it speed up screen capture versus color capture?
If it speeds up the capture, it will be better than applying filters.
Is it possible to record ...
0
votes
2
answers
498
views
TclError: image "pyimage3" doesn't exist (works only on first run)
I'm trying to create a screenshot area tool which can be triggered from python code.
It works at first call but, on second call I get bellow error:
TclError: image "pyimage2" doesn't exist
...
0
votes
1
answer
1k
views
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 ...
2
votes
1
answer
1k
views
how to capture the mouse pointer in screenshot
I use the python-mss to capture the screenshot and use these screenshot with opencv to generate a video recording. As I want to capture the mouse movement in the video.
But it seems that the mouse ...
1
vote
1
answer
1k
views
Python screen share
Hi Im trying to build an application in python 3 for screen sharing and I looked in other codes from the internet (some of them from StackOverFlow) and all of them just rapidly open up screenshots of ...
2
votes
0
answers
94
views
Is there anyway to take a screenshot with maximum PPI?
I'm trying to take screenshot on my Mac and for I need to pass the screenshot to pytesseract, I'd like to know if there is anyway for grabbing a region of the screen at the maximum PPI.
I noticed that ...
0
votes
1
answer
446
views
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.
...
7
votes
1
answer
603
views
Is there a way to take screen shots of desktop that not current active one using mss?
I'm trying to record screen when playing a website by using mss and opencv, but I don't want the program to use the current screen. I want to put them to play on a second desktop, like Desktop 2 in ...
0
votes
3
answers
6k
views
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, ...
0
votes
1
answer
621
views
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 ...
1
vote
0
answers
182
views
Facing an issue while taking screen shots with python
I am facing an issue while taking screen shots using mss module in python, sometimes it is working fine and some times giving black screen as output. Please provide me solution for this problem.
I ...
0
votes
1
answer
292
views
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, ...
0
votes
2
answers
470
views
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==...
0
votes
0
answers
980
views
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 ...
1
vote
1
answer
276
views
MSS repeats frames when recording computer screen
I am trying to record the screen on my MacBook pro and store it in a video file. This isn't the end goal but this is the first step and I am noticing whatever I set my writing framerate to, I only get ...
0
votes
2
answers
178
views
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 ...
2
votes
2
answers
2k
views
XGetImage Failed Error when using python MSS library on Ubuntu
I'm encountering an error when using mss, on Ubuntu 18.10 (if that matters). Here's my code (Taken from their examples in the documentation, plus some extra error output):
import mss
with mss.mss() as ...
2
votes
2
answers
422
views
Accelerating a screenshot function - Python
I need my screenshot function to be as fast as possible, and now every call to the function takes about 0.2sec.
This is the function:
def get_screenshot(self, width, height):
image = self....
1
vote
0
answers
148
views
python mss ScreenShotError
So basically I'm just messing around with mss (python2.7 and 3.6), and I have the following code:
import mss
import cv2
import numpy as np
with mss.mss() as sct:
mon = {'top':40,'left':0, 'width'...
2
votes
1
answer
676
views
How does one find a pixels location from image.pixel?
So, i have this script which works, it prints out all the pixels that have and rgb value of (102,102,102) but i don't know how I would be able to now get that pixels location and click it.. any ...
2
votes
1
answer
731
views
How to I make my python program take screenshots faster?
I have been working on this script that clicks the wherever the pixel of a certain color is on the screen, but i ran into a problem, when i loop this it takes screenshots, but only about 12 during a ...
0
votes
1
answer
689
views
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[...
2
votes
1
answer
3k
views
Fastest screenshot library python/improve performance of mss package
python 3.6, Windows 10:
I am trying to take one (partial) screenshot every 1-5 milliseconds to then run some custom OCR on it to extract some data.
My code for taking the screenshots using the mss ...
1
vote
1
answer
2k
views
Using python mss to draw bounding box on top of screen record
I have code to screen record and with each frame I have a set of bounding boxes I want to display on each frame. I can do this using matplotlib or something but I mss is working at like 30fps and I ...
3
votes
0
answers
1k
views
Getting black or white image when calling mss screenshot function second time
I used mss module (https://pypi.org/project/mss/) to make screenshots. When calling function second time, I get black or white image. The weirdest thing is that ocasionally it succeeds.
I tried ...
0
votes
1
answer
388
views
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 ...
2
votes
0
answers
2k
views
opencv python screen capture in ubuntu
I am trying to capture the screen and show the images continuously using opencv-python. But for some reason the images are not stacking on top of each others like normally. Please look at the source ...
1
vote
1
answer
4k
views
convert mss screenshot to pil image
Im using mss to take a screenshot because it apparently can take fast screenshots. So is there a way to convert it into an image without saving it on my computer(its faster) like image.grab() in ...
1
vote
1
answer
4k
views
mss module is installed but program is unable to import it (using single version of python)?
I am making a Python program for converting PDF files into images by taking screenshots.
Am using Anaconda 3 with Python 3.6.5 (running on Windows 10 Enterprise)
There is no other Python version ...
0
votes
1
answer
2k
views
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 ...
-1
votes
1
answer
86
views
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 ...
3
votes
2
answers
3k
views
Can't record screen using mss and cv2
I have the following code
from mss import mss
import cv2
import numpy
class MSSSource:
def __init__(self):
self.sct = mss()
def frame(self):
monitor = {'top': 0, 'left': 0, '...
2
votes
0
answers
1k
views
Resize screenshot with mss for better reading with pytesseract
I need to resize an screenshot taken by mss in order to get better reading by pytesseract and i get it done with pil+pyscreenshot but can't get it to with mss.
from numpy import array, flip
from mss ...
1
vote
1
answer
1k
views
Is there a way to use mss and pytesseract witchout saving and open?
Need to use mss witchout saving and open images in order to "optimize" this task here is mine code and sorry my bad english.
from PIL import Image
import pytesseract
import mss
import mss.tools
with ...