What is the "right" way to render streaming binary image data in React? Given jpg frames as arraybuffers, do I: 1. <img> in component, create blob URL and put in state or props then src={url} 2. <canvas> in component, create blob URL and Image(), drawImage(img) to canvas 3. ?
-
-
Replying to @humphd
How important is zero garbage vs raw perf? What size images? 3 could be "write component in wasm, including a compiled jpeg decoder that just calls putImageData"
1 reply 0 retweets 1 like -
Replying to @vvuk
I wondered about this, too. I was reading the code for https://github.com/phoboslab/jsmpeg …, and it basically does this for MPEG. I started to map out a solution for JPEG instead, and then decided I was overthinking it. My images are small (~700x400).
1 reply 0 retweets 0 likes
The absolute fastest way would probably be to decode the JPEG on GPU, but that’s way overkill. (I want to do this in Firefox someday though.)
12:21 PM - 20 Feb 2020
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.