You would need a proxy server to somehow intercept the YouTube video and serve it in a CORS compatible way else you will run in to cross domain canvas tainting issues as unless special headers are set you cant sample content from another site, for obvious reasons.
Maybe a chrome extension is better because then it can access all content on pretty much any website. TensorFlow.js could run in a Chrome extension instead and then it could do whatever you need.
You could then overlay your output on top of the video if you wanted.
To sample many frames you should use some sort of animation loop using requestAnimationFrame to ensure you dont burden the computer running. It will call a function of your choosing when it is ready to instead of you forcing some number of milliseconds which may not be appropriate if on a low powered computer if it cant keep up.
Real time performance is certainly possible with TFJS in browser though depending on the model you are trying to run. Our MoveNet model can run at 120 fps on a desktop with 1070 NVIDIA GPU for example.
Check TFJS glitch for many examples of TFJS in action...
https://glitch.com/@TensorFlowJS/official-tutorials-templates
Good luck!
for sure : https://codesandbox.io/s/interesting-hellman-18f2e
forreal, i really appreciate the look-over. The code you sent over looks great, but im wondering if my code is just a few nudges from running.
Awesome! I just imported a project from GitHub. Very easy, it just worked without any changes :)
Maybe you'd like to add this activation function tool to the collection? https://glitch.com/~tfjs-activation-functions