I am curious to try some crude jumbling of an mp4 file for security. The mp4 will be un-jumbled on the client side before drawn to the video texture.
I know how to do this by drawing the mp4 to canvas and then drawing the canvas to a texture. However, that may be inefficient given the video is 4k.
I notice threejs has VideoTexture and CanvasTexture, does anyone know an efficient solution that can unjumble an mp4 without drawing again to a canvas?
Can the un-jumbled video be played with a regular
HTMLVideoElement? If so you can use is directly with a
VideoTexture, if not you’ll have to use
CanvasTexture, draw each frame to the canvas and refresh the texture with
texture.needsUpdate = true. The first options is the most efficient, the second is the alternative.
Use videotexture to get the video into a shader, and unjumble in the shader?
Pretty sure anything with an intermediate hop to canvastexture is gonna be a bit sloooww.
Another issue is that any kind of jumbling you do probably destroys the compression ratios since the codecs aren’t designed for jumbled images? Maybe that doesn’t matter… Interesting idea.
I’m with you on this one, I mean if netflix, youtube and the entire video industry can’t protect there videos from being downloaded … Should/can you?
Thanks for the replies. Will look into a shader approach @manthrax
The intention is not to prevent download. Anyone can download the jumbled video. The unjumbled video is only viewable in XR session as a video texture. Yes, they can screen record from XR, but it’s going to look a bit odd. It’s only a crude security measure.
Yeah… I think I understand. Curious what you come up with.