VideoFrame.copyTo is manipulating JS objects in a background queue
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- javascript
- Domain
- api
Research direction
Start with the WebCodecs specification's VideoFrame.copyTo algorithm and trace where the JS-visible destination is written and where RGB conversion occurs. Compare the four proposed API or specification directions, then define a chosen approach whose completion criteria cover safe destination mutation and the desired handling of RGB conversion.
Written by the indexing model from the issue text.
Description
As per https://w3c.github.io/webcodecs/#dom-videoframe-copyto,`destination` which is a JS visible object is written from a background queue task, which is an anti-pattern.
This creates problems (JS observability, destination mutating during the copyTo tasks).
There are various ways to fix this, for instance:
- make
copyToalgorithm synchronous - Expose a new asynchronous API that would transfer the destination buffer and provide the returned value as part of the promise value.
- Extend
copyToAPI surface to implement 2 within it. - Change the spec to write
destinationasynchronously but in an event loop task with additional checks, even if UA may do it in a smarter way.
As a side note, copyTo algorithm is also synchronously converting to RGB.
It would be convenient to do this asynchronously, which is feasible by cloning the VideoFrame synchronously and using the cloned VideoFrame in the remainder of the algorithm.
- Dominant language
- HTML
- Stars
- 1.3k
- Forks
- 193
- Avg merge
- 14d 2h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/webcodecs
-
privacy-needs-resolution
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
editorial
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
ColorSpace override is not well definedMay be free again @dalecurtis claimed this 29 days ago, and no pull request is open. Openagenda CR Blocking
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
clarify ImageTrack repetition countMay be free again @dalecurtis claimed this 165 days ago, and no pull request is open. Open
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
dani-garcia/vaultwarden#7801 ·
Maintainers usually reply within 1 day
-
🐛 Bug supabase/cli
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area/auth comp/gateway P2 sweeper:risk-message-delivery type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
NousResearch/hermes-agent#131962 ·
Maintainers usually reply within 1 day