luxonis / depthai-core

DepthAI C++ Library
MIT License
235 stars 127 forks source link

[BUG] Camera doesn't set default preview/video size #894

Open Erol444 opened 1 year ago

Erol444 commented 1 year ago

Changing the c.isp to preview or video makes the script crash, as (I assume) depthai doesn't specify default video/preview size.

#!/usr/bin/env python3
import depthai as dai

# Connect to device and start pipeline
with dai.Device() as device:
    print('Connected cameras:', device.getConnectedCameraFeatures())

    # Create pipeline
    pipeline = dai.Pipeline()
    c = pipeline.create(dai.node.Camera)
    c.setBoardSocket(dai.CameraBoardSocket.CAM_A)

    x = pipeline.create(dai.node.XLinkOut)
    x.setStreamName('a')
    # Linking c.video or c.preview will crash the pipeline with
    # RuntimeError: Camera(0) - 'video' width or height (-1, -1) must be bigger than (32, 32)
    c.isp.link(x.input)

    # Start pipeline
    device.startPipeline(pipeline)
Shivam7Sharma commented 4 months ago

This is still an issue. I am using the latest depthai-python branch, and when I change preview to isp, I don't get the error.