JavaScript Can I write videos pixel-by-pixel in javascript?

I am trying to port a program from python (using OpenCV) to javascript/html, which generates a video where pixel colour are determined by a random function of its coordinates and its frame number.

I already created a program that creates still images in this fashion in javascript/html, but I'm having trouble with the video equivalent as I don't know how to create a video from raw pixel data, or if that's even possible.

I've already tried this code:

var video = document.getElementById('Video')
var canvas = document.getElementById('Canvas')
var ctx = canvas.getContext('2d')
var apx = ctx.getImageData(0, 0, 200, 200);
var data = apx.data;

for(var i = 0; i < data.length; i+=4)
{
  data[i] = 255
  data[i+1] = 0
  data[i+2] = 0
  data[i+3] = 255
}
apx.data = data;
ctx.putImageData(apx, 0, 0);
ctx.drawImage(video, 0, 0)
<canvas id='Canvas' width=200 height=200></canvas>
<video width=200 height=200 id='Video' controls></video>
Answer:1

I was having and bizarre error and I just want to understand why. I was getting a 'bad route' return from my css and Javascript files. As it turns all my paths were correct but the problem was caused ...

I was having and bizarre error and I just want to understand why. I was getting a 'bad route' return from my css and Javascript files. As it turns all my paths were correct but the problem was caused ...

In the following piece of code store.nextId and store.cache is used in the add method. I was wondering why not this? var store = { nextId: 1, cache: {}, add: function(fn) { if (!fn.id) { ...

In the following piece of code store.nextId and store.cache is used in the add method. I was wondering why not this? var store = { nextId: 1, cache: {}, add: function(fn) { if (!fn.id) { ...

Using jQuery I can create a real DOM node, but it is not located in the DOM. So how does jQuery do it? My guess that it might create it first in the DOM and then removes it. // here `el` is not a ...

Using jQuery I can create a real DOM node, but it is not located in the DOM. So how does jQuery do it? My guess that it might create it first in the DOM and then removes it. // here `el` is not a ...

  1. jquery on dynamically created elements
  2. dynamically created elements jquery event
  3. bind dynamically created elements jquery
  4. jquery selecting dynamically created elements
  5. jquery each dynamically created elements
  6. jquery handle dynamically created elements
  7. jquery count dynamically created elements
  8. create html elements in jquery
  9. jquery selecting created elements

I was wondering if there is any method (using JS or otherwise) to autosubmit a form with a field with name and id as 'submit'. Essentially, my entire HTML code looks like this: <html> <body ...

I was wondering if there is any method (using JS or otherwise) to autosubmit a form with a field with name and id as 'submit'. Essentially, my entire HTML code looks like this: <html> <body ...

  1. javascript form submit event
  2. javascript form submit not working
  3. javascript form submit event listener
  4. javascript form submit function
  5. javascript form submit callback
  6. javascript form submit button
  7. javascript form submit action
  8. javascript form submit validation
  9. javascript form submit ajax
  10. javascript form submit json
  11. javascript form submit get values
  12. javascript form submit without redirect
  13. javascript form submit prevent default
  14. javascript form submit handler
  15. javascript form submit on enter
  16. javascript form submit post
  17. javascript form submit parameters
  18. javascript form submit multiple buttons
  19. javascript form submit onsubmit
  20. javascript form submit listener