Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PiCamera() does not work with hdmi off #120
I'm using RPi without screen and on batteries, so I'd like to switch off hdmi to save some mW (tvservice -o). But if I do, PiCamera() does not initialize (complains about invalid camera preview format in preview port settings). raspistill works well in the same condition, but I can't tell if a preview is showed or not.
Okay - I know what the issue is here : picamera attempts to be friendly and sets its initial resolution to the display resolution which is determined with bcm_host.graphics_get_display_size. When HDMI is disabled this returns -1 (which we don't check), and leaves the resolution as 0x0 (which naturally fails when we try to configure the preview). I'll add a check for a -1 return code and default the res to something sensible like 720p in that circumstance.