Repository navigation
Conversation
Request the recorded capture size first, then retry at fallback resolutions when the stream delivers no frames. Keep previews framed to the recorded aspect ratio and crop mismatched streams.
sysradium
force-pushed
the
camerate-feed-fix
branch
from
October 24, 2026 22:07
0b13953 to
08bc2ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS in Firefox, the Innomaker U20CAM preview stayed grey even though macOS showed the camera as in use. It would open at 640脳480 but send no frames until another app (e.g. FaceTime) started it at a larger size. OpenCV gets frames at 640脳480, so recording was never affected; only the browser previews were.
Tested in Firefox with nothing else using the camera:
So with this pr:
useCameraStreamtakes the camera's saved capture size and requests it first. If no frame arrives within 2.5 s, it reopens at 1280脳720, then 1920脳1080. All sizes areidealconstraints, so a camera that can't meet them still opens. Cameras that stream at their saved size never reach the fallback.BrowserCameraPreviewsizes its box from the saved capture size instead of the stream's actual size.cameraPreviewGeometrynow usesobject-fit: cover, so a stream at a different aspect ratio (e.g. a 16:9 fallback for a 4:3 recording) is center-cropped and the preview shows the framing that will be recorded.Removed the
metadatastate (setMetadataonloadedmetadata) fromBrowserCameraPreview. It stored the stream's actualvideoWidth/videoHeightand sized the box from them, which is what made a 16:9 fallback stream show a wider view than the 4:3 recording. Now that the box always takes the saved size's shape, nothing reads the stream's size. ItsdeviceIdcheck, which stopped a reassigned preview from reusing the previous camera's size, is no longer needed either. One consequence: a preview no longer shows when the browser picked a different size, because the image is cropped to the recorded framing.Recording still captures at the saved size; LeRobot raises an error if it can't set it.
The recording page's live view (
/camera-feed) already showed the recorded frames and is untouched.Teleoperation doesn't open cameras on the backend.
Notes