78 questions
0
votes
0
answers
36
views
MSS creating windows at different locations
I have taken this snippet from the docs. However, there is an issue where the screen keeps sliding down. I am unsure of how to fix this. It fixes when I move it out of the captured region, but that is ...
1
vote
1
answer
475
views
In python how to synchronize screengrabs with vertical sync
I'm using python v 3.8.9 with windows 7 and grabbing portions of the screen using the mss module.
I'm attempting to capture output of a program that updates with the monitor vertical sync at ~60 FPS. ...
0
votes
1
answer
415
views
tkinter screenshot with mss not working as expected
essentially the problem is: I want to take a screenshot of my tkinter canvas.
Unfortunately I am not able to understand PIL, so don't gaslight me with Pillow or ImageGrab please.
from mss import mss
...
0
votes
1
answer
38
views
Why does my cv2 slider keep starting with "None"
My CV2 slider keeps starting with the value "None", but I need it to be an int instandly. The error code I'm getting is this: TypeError: int() argument must be a string, a bytes-like object ...
0
votes
0
answers
553
views
What causes an mss.exception.ScreenShotError: gdi32.GetDIBits() failed
I'm trying to write some code to use screencaptures to export the position from a online-go.server. I only got a few lines in, when I got this error from this code
error
c:\Go\sgo>py ogs2kgs.py
top ...
0
votes
1
answer
2k
views
Python MSS Screenshot monitor sizes different than expected
Using mss, I have taken screenshots of my two monitors: monitor-1 and monitor-2.
When I open up monitor-1, I get the image size of 3840x2160. However, when accessing monitors from mss().monitors[1], I ...
1
vote
1
answer
481
views
Screenshot error: XDefaultRootWindow() failed after closing a Tkinter Toplevel --> Python MSS Ubuntu Linux
Ubuntu v22.04
MSS v7.0.1
Python 3.10
This issue is practically identical to: Python: Tkinter + MSS = mss.exception.ScreenShotError: XDefaultRootWindow() failed - however, their question is unsolved. ...
0
votes
2
answers
2k
views
What is the color space produced by MSS sct.grab()?
Python 3.10,
opencv-python==4.5.4.60
I'm having a hard time understanding the color format of screenshots taken by MSS.
Here is the portion of my screen that I am screenshotting (with correct/expected ...
0
votes
1
answer
165
views
Emotion Detect on live screen
Trying to build a system to detect emotion in online meeting using python.
I have created a deep learning model to detect emotions.
Using this code to view the screen
import time
import cv2
import mss
...
0
votes
1
answer
2k
views
python opencv2 record screen
I am trying to make a screen recorder using python opencv along with the mss library.
I can not get it to record a video. Whenever I stop the application - the file size becomes static such as sizes ...
1
vote
1
answer
2k
views
Python mss only capturing 60 fps, even with multiprocessing?
I've been using mss for screen capturing for a while, and no matter what I can't get it above 60 fps, even with multiprocessing. Here's the code:
import multiprocessing as mp
import time
import mss
...
-1
votes
1
answer
76
views
Should there be used a different method for object detection when used cv2.Canny?
I'm trying to implement the usage of cv2.Canny(), but no matter which approach and method I'm using I'm not getting the object detected. So here I'm raising a question about whether there could be ...
1
vote
1
answer
1k
views
OpenCV wont object detect with MSS screen capture
I'm new to Python and want to learn it bit by bit, so I decided to write a simple program that would, in real time, capture my screen and do object detection. Through a lot of googling and reading, I ...
-1
votes
1
answer
368
views
OpenCV imshow function not responding [duplicate]
I try to detect color on the screen in real time and when I'm using imshow function it is not responding and I can't see my screen live
Someone can help?
import numpy as np
from PIL import Image
from ...
0
votes
0
answers
969
views
Recording full screen at lower resolution (mss)
I am trying to make a Python script that records my entire screen but on a 70x34 resolution while cutting off as little as possible on a 16:9 monitor. I have this example code down below that uses the ...
0
votes
2
answers
2k
views
OpenCV Not Properly Writing Adding Frames to Video
I'm using mss, numpy, and OpenCV to make my own recording software, but when I record, all of my videos end up with a 258 bytes file size (no matter the length of the video), and I can't view the ...
0
votes
1
answer
1k
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
702
views
Mss grab to numpy to cv2MatchTemplate
sorry in advance if the question as been requested .
I want to take a screenshot with MSS ,
send it to CV2 ( for template matching ) with NUMPY (and after do euclidian distance for fin the closest ...
0
votes
0
answers
347
views
cannot import name 'mss' from partially initialized module 'mss' (most likely due to a circular import)
mss library bug, I was trying most simple Example Program.
I have reinstall that library but still same error.
from mss import mss
with mss() as sct:
sct.shot()
And that's what I got.
2
votes
0
answers
185
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
771
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 ...
3
votes
1
answer
7k
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
2k
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 ...
1
vote
1
answer
2k
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
442
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
563
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
23k
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
338
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
849
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 ...
1
vote
1
answer
3k
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 ...
2
votes
1
answer
611
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
9k
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
1k
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 with ...
0
votes
3
answers
864
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
2k
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
3
answers
3k
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
2k
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
138
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
976
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
1k
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
4
answers
22k
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
1k
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
347
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
1k
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
510
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
2k
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
437
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
306
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
6k
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
615
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....