-
Notifications
You must be signed in to change notification settings - Fork 458
Add codec option to webcam source #5102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a codec selection option to the webcam source configuration, allowing users to choose from a list of video codecs (XVID, MJPG, YUY2, H264, H265, MP4V, DIVX) when configuring a webcam input source.
- Introduces a codec picker component with predefined codec options
- Updates the form submission to include the selected codec
- Adds test coverage for the new codec field
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| application/ui/src/features/inference/sources/webcam/webcam.component.tsx | Adds codec picker UI component and includes codec in form data submission |
| application/ui/src/features/inference/sources/webcam/webcam.test.tsx | Updates test configuration and assertions to verify codec field behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
application/ui/src/features/inference/sources/webcam/webcam.component.tsx
Outdated
Show resolved
Hide resolved
application/ui/src/features/inference/sources/webcam/webcam.component.tsx
Outdated
Show resolved
Hide resolved
📊 Test coverage report
|
Docker Image SizesCPU
GPU
XPU
|
MarkRedeman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I think we should first add camera discover to the backend and integrate it into the UI.
Aurelien added this in #5101
After this we should look into exposing configuration capabilities to this endpoint. As an example in Geti Action we are exposing a /api/cameras/supported_formats?driver=xxx&fingerprint=yyy endpoint that returns the following combinations of resolution x fps for one of my cameras:
[
{
"width": 640,
"height": 360,
"fps": [
30
]
},
{
"width": 640,
"height": 480,
"fps": [
30
]
},
{
"width": 800,
"height": 600,
"fps": [
30
]
},
{
"width": 1024,
"height": 576,
"fps": [
30
]
},
{
"width": 1280,
"height": 720,
"fps": [
5,
10,
30
]
},
{
"width": 1280,
"height": 960,
"fps": [
30
]
},
{
"width": 1920,
"height": 1080,
"fps": [
5,
30
]
}
]
We could extend this to also include codec information.
UX wise we will need to figure out how to expose these settings.
I think it would be better to choose smart defaults and only allow users to change these when they click on some "advanced settings" option as now beginner users might be confused as to which codec they should choose.
| aria-label={'List of codecs'} | ||
| defaultSelectedKey={String(state?.codec)} | ||
| > | ||
| {LIST_OF_CODECS.map((codec) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we filter these based on what the camera supports?
Summary
How to test
Checklist