Skip to content

Don't copy video chunk data #7878

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

Open
jprochazk opened this issue Oct 23, 2024 · 0 comments
Open

Don't copy video chunk data #7878

jprochazk opened this issue Oct 23, 2024 · 0 comments
Labels
📉 performance Optimization, memory use, etc 🚜 refactor Change the code, not the functionality 🎞️ video

Comments

@jprochazk
Copy link
Member

#7481 (comment)

Even after #7860 we still copy video data for each sample. But Blob is a Arc<Vec<u8>> internally, so we should be able to avoid that as well. The decoder could receive a sub-slice of the Blob instead of copying the data to its own Vec. For web, it's possible to give the JS video APIs a direct reference to Wasm's linear memory, using the unsafe Uint8Array::view, which means constructing the EncodedVideoChunk will not require a copy either.

@jprochazk jprochazk added 📉 performance Optimization, memory use, etc 🎞️ video 🚜 refactor Change the code, not the functionality labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📉 performance Optimization, memory use, etc 🚜 refactor Change the code, not the functionality 🎞️ video
Projects
None yet
Development

No branches or pull requests

1 participant