vcync / modV

modular audio visualisation powered by JavaScript
https://modv.vcync.gl
MIT License
450 stars 25 forks source link

Video support #521

Closed TimPietrusky closed 1 year ago

TimPietrusky commented 3 years ago

Is your feature request related to a problem? Please describe. People are using videos when they compose their visual sets and want to use them in modV. People have a music video ready and want to apply some awesome effects in modV to use that for a live gig.

Describe the solution you'd like Use a component to add a video (e.g. Texture 2D) that provides playback methods for the video:

Describe alternatives you've considered See https://github.com/vcync/modV/discussions/501#discussioncomment-197293

2xAA commented 3 years ago

We may be able to support video without moving outside of the worker, but we may need extra node.js conversion steps. For example, .basis Universal Texture Video can be used without <video> or DOM APIs: http://binomial.biz/TextureVideoTest/

TimPietrusky commented 3 years ago

We are working on getting support for this via https://github.com/vcync/modV/issues/569

2xAA commented 2 years ago

Realistically, #569 is a long way off and should probably be part of "modV 4", whenever that happens.

But, as all things Chromium transpire, you wait long enough and there's a new API to use. This explains how to decode an MP4 in a Worker and extract frames:

https://w3c.github.io/webcodecs/samples/mp4-decode/

Other resources: https://gpac.github.io/mp4box.js/#seektime-userap https://web.dev/webcodecs/ https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API


Could be viable. Slow down only really occurs on multiple 1080 videos. Stress test here: https://cn363.csb.app/

2xAA commented 2 years ago

695 is related as it will essentially use the same interface.

This is an updated stress test using the preferred method of sending the whole video stream to the worker, rather than frames. https://r3w32.csb.app/

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.27.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: