# Video Capture Constraints

DevFeed: [Video Capture Constraints](<https://devfeed.tech/articles/video-capture-constraints-19661.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/video-capture-constraints/>)

Author: Steve Hannah

Published: 2019-03-12T00:00:00Z

Content type: article

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [webcam](<https://devfeed.tech/topics/webcam.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [capture](<https://devfeed.tech/tags/capture.md>), [component](<https://devfeed.tech/tags/component.md>), [layout](<https://devfeed.tech/tags/layout.md>), [platform](<https://devfeed.tech/tags/platform.md>), [quality](<https://devfeed.tech/tags/quality.md>), [video](<https://devfeed.tech/tags/video.md>)

## AI overview

This article explains a video capture constraints API for specifying preferred video quality, maximum duration, maximum file size, and resolution. It describes runtime support checks and notes that constraint support varies by platform and device.

## Source excerpt

The new video capture constraints API allows you to specify "constraints" when capturing videos. Constraints include: Video Quality (High or Low) Maximum duration Maximum file size Video Resolution (i.e. width and height). Support for these constraints varies by platform and device, but the API allows you to check if your constraints are supported at runtime. Essentially, you set your "preferred" constraints, and the API will give you its best attempt at meeting those constraints. This is similar to setting a visual Component's preferred width and height. The layout manager takes these preferred dimensions under advisement, but ultimately sets the size on its own.