-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update webcam module to set the camera framerate #390
Conversation
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
==========================================
- Coverage 47.16% 47.12% -0.05%
==========================================
Files 67 67
Lines 4380 4386 +6
==========================================
+ Hits 2066 2067 +1
- Misses 2189 2194 +5
Partials 125 125
Continue to review full report at Codecov.
|
pkg/driver/camera/camera_linux.go
Outdated
@@ -179,6 +179,11 @@ func (c *camera) VideoRecord(p prop.Media) (video.Reader, error) { | |||
return nil, err | |||
} | |||
|
|||
err = c.cam.SetFramerate(float32(p.FrameRate)) |
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.
How it behaves when user doesn't explicitly specify frame rate?
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.
Good point. I will check that.
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.
I added some tests. When the framerate is not specified the constraint seems to be ignored.
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.
p.FrameRate
seems to be 0 when user doesn't set frame rate.
I think it's better not to call SetFramerate in this case.
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.
Done in a21eab0
It seems irrelevant to the changes introduced in this PR. |
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.
LGTM
Description
This PR updates the webcam module to
ba064708e1652773bdb71e0605a1819ef4fad2e7
which allows to set (and get) the video camera capture framerate based on theFrameRate
value specified inprop.Media
.