Skip to content
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

Question about video memory usage / improvement #65

Open
billnye2 opened this issue Jan 11, 2025 · 1 comment
Open

Question about video memory usage / improvement #65

billnye2 opened this issue Jan 11, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@billnye2
Copy link

billnye2 commented Jan 11, 2025

Hello,

I'm trying to support large video files (4k 60fps - multi-gig), but my concern is that will make the browser tab run out of memory because this library loads the entire video into memory when rendering. However, I see that when previewing the video on the page with attachPlayer, it appears to start playing almost immediately, with a document.createElement('video') in js controlling it.

My question: why not use this js video element to loop through its frames when rendering the video, instead of the current behavior which downloads the entire video into memory and extracts frames with the ffmpeg worker? My hope is that this would reduce memory usage because the video would be handled by the browser itself which can offload the video data onto disk / apply memory strategies. This lib currently loads the video into a blob which takes loads of memory.

Hopefully that makes sense. Please let me know your thoughts.
Thank you!

@k9p5
Copy link
Contributor

k9p5 commented Feb 4, 2025

This is certainly an issue at the moment. Unfortunately, the html video element is to slow and doesn’t support frame exact extraction. We're currently working on a solution based on WebCodecs that will lead to the same result. Should be available in 2-3 weeks.

@k9p5 k9p5 added the enhancement New feature or request label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants