werthdavid / homebridge-website-to-camera

Homebridge plugin that displays a Website as virtual camera (intended for Google Maps Traffic)
MIT License
54 stars 7 forks source link

Increase resolution of screenshot? #2

Closed schteeben95 closed 6 years ago

schteeben95 commented 6 years ago

Is there a way to increase the resolution of the screenshot?

werthdavid commented 6 years ago

Yes, there are two options.

1.: Use a specific width and height:

   {
          "name": "Google Maps Traffic",
          "url": "http://google.com",
          "height": 1334,
          "width": 750
        }

2.: Use a Scale-factor.

   {
          "name": "Google Maps Traffic",
          "url": "http://google.com",
          "scale": 2
        }

I would go for a scale factor for the following reason: HomeApp requests a desired resolution to the plugin. This desired resolution usually differs on different devices (e.g. iPad requests an higher resolution than an iPhone). With scale=2 you just double the resolution of the screenshot. With a fixed width/height you would force a fixed resolution that could lead to black border or something..