Skip to content

Saving image in the loop freezes #133

@repkovsky

Description

@repkovsky

I am capturing image from webcam using code from demo. Unfortunately after triggering capture with camera button in ImageRecorder, I see only 3 updates in the output Image and then the loop freezes.

camera = CameraStream(constraints={'facing_mode': 'user', 'audio': False, 'video': { 'width': 640, 'height': 480}})
image_recorder = ImageRecorder(stream=camera)
out = Image()
stop_process = False

def process_image(_):
    if stop_process:
        return
    out.value = image_recorder.image.value
    image_recorder.recording = True

image_recorder.image.observe(process_image, names=['value'])
image_recorder.recording = True
HBox([out, image_recorder])

I found that this can be functionally solved by setting callback to image_recorder.recording change by image_recorder.observe(process_image, names=['recording']), but this is only workaround of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions