balena-cam icon indicating copy to clipboard operation
balena-cam copied to clipboard

Change video resolution

Open cbarratt opened this issue 5 years ago • 1 comments

Is it possible at all to change the video resolution? It appears to be drastically low quality :( I was hoping for some environment variable to use for this

cbarratt avatar Nov 06 '20 15:11 cbarratt

in app/server.py change lines 15-16

        self.cap.set(3, 640)
        self.cap.set(4, 480)

640 = width 480 = height

If you want them to be environment variables, do something like

import os
...
CAP_WIDTH = os.environ.get("CAP_WIDTH", 640)
CAP_HEIGHT = os.environ.get("CAP_HEIGHT", 480)
...
        self.cap.set(3, CAP_HEIGHT)
        self.cap.set(4, CAP_WIDTH)

sinclairnick avatar Nov 19 '20 02:11 sinclairnick