vncdotool icon indicating copy to clipboard operation
vncdotool copied to clipboard

Artifacts on screenshots

Open GiulioBen opened this issue 2 years ago • 2 comments

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

GiulioBen avatar Nov 16 '23 16:11 GiulioBen

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.

pmhahn avatar Jun 17 '24 13:06 pmhahn

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

GiulioBen avatar Sep 20 '24 08:09 GiulioBen