Skip to content
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

Artifacts on screenshots #275

Open
GiulioBen opened this issue Nov 16, 2023 · 2 comments
Open

Artifacts on screenshots #275

GiulioBen opened this issue Nov 16, 2023 · 2 comments

Comments

@GiulioBen
Copy link

GiulioBen commented Nov 16, 2023

Dear community,
i'm facing a problem with the screenshots:

When I'm connected to the server through my UltraVNC client, everything works like a charm.

When i disconnect and i use the vncdotool inside a python script, the screenshots are full of artifacts. I attach an image as example (it's only a part of the screen). Sometimes it shows the old screen (when i disconnected), other times the colors are wrong.

image

The VNC server is very old, running windows XP, but my UltraVNC client is not having any trouble.

When i connect i have this log

2023-11-16 17:27:54,636 - twisted - INFO - Starting factory <vncdotool.client.VNCDoToolFactory object at 0x000002DA28840E20>
2023-11-16 17:27:54,638 - twisted - INFO - Protocol version 3.6 not supported
2023-11-16 17:27:54,639 - twisted - INFO - Using protocol version 3.3
2023-11-16 17:27:55,704 - twisted - INFO - Native PixelFormat(bpp=32, depth=32, bigendian=False, truecolor=True, redmax=255, greenmax=255, bluemax=255, redshift=16, greenshift=8, blueshift=0) bytes=4
2023-11-16 17:27:55,704 - twisted - INFO - Offering <Encoding.RAW: 0>
2023-11-16 17:27:55,704 - twisted - INFO - Offering <Encoding.PSEUDO_DESKTOP_SIZE: -223>
2023-11-16 17:27:55,704 - twisted - INFO - Offering <Encoding.PSEUDO_LAST_RECT: -224>
2023-11-16 17:27:55,704 - twisted - INFO - Offering <Encoding.PSEUDO_QEMU_EXTENDED_KEY_EVENT: -258>
2023-11-16 17:28:06,732 - twisted - INFO - x=0 y=0 w=1024 h=768 <Encoding.RAW: 0>

I just use this syntax to connect

client = api.connect(ipVNC, pwVNC)

I tried to do several consequent screenshots but it seems that the server is not updating at all the image.

Thank you for the support.

Best

@pmhahn
Copy link
Collaborator

pmhahn commented Jun 17, 2024

Please provide more information:

  • You're using the synchronous API, which is still experimental, but your log-output-format looks different: it includes time stamp information, so I assume using vncdotool is part of your application. Do you use the Twisted reactor in any other way?
  • api.connect() just opens the connection, but how do you actually get the screenshot? Are you using client.captureScreen() or any other function from VNCDoToolClient? If yes, please include that information.
  • Does the command line wrapper vncdotool -s "$ipVNC" -p "$password" -u "$username" capture "some-file.png" work okay or does it also return a garbled image? If not, then the bug might be in how you use the API.

@GiulioBen
Copy link
Author

Please provide more information:

* You're using the **synchronous** API, which is still experimental, but your log-output-format looks different: it includes time stamp information, so I assume using `vncdotool` is part of your application. Do you use the Twisted reactor in any other way?

I'm using the synchronous API and just changing the logging format:

from vncdotool import api
import logging

logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.INFO
)
* `api.connect()` just opens the connection, but how do you actually get the screenshot? Are you using `client.captureScreen()` or any other function from `VNCDoToolClient`? If yes, please include that information.

client.captureScreen(filename)

* Does the command line wrapper `vncdotool -s "$ipVNC" -p "$password" -u "$username" capture "some-file.png"` work okay or does it also return a garbled image? If not, then the bug might be in how you use the API.

the png files obtained directly from cmd contains the artifacts.

I noticed that when I connect with the UltraVNC client the first frame contains artifacts but then the screen is suddendly refreshed and the artifacts disappear. If i use vncdotool when also the UltraVNC client is connected no artifacts are detected. As soon as the UltraVNC client disconnects the artifacts suddendly appear.

The VNC server version is quite old and running on windows XP

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants