Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

VideoFrame.copyTo is manipulating JS objects in a background queue

Open
#955 3 comments 0 reactions 0 assignees View on GitHub

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:

  1. make copyTo algorithm synchronous
  2. Expose a new asynchronous API that would transfer the destination buffer and provide the returned value as part of the promise value.
  3. Extend copyTo API surface to implement 2 within it.
  4. Change the spec to write destination asynchronously 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/webcodecs

All issues in w3c/webcodecs

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.