analog-tv-simulation
analog-tv-simulation copied to clipboard
How to plug in video?
Hi substack! Lovelovelove this project! I was hoping to hack it a bit for an analog horror project I'm working on, but to do that I'd need to plug in a video source to one of the channels, but I don't see an example of that in the current code. Is there an easy way to do that, or would I need to get into all the internals to make that happen?
Thanks again for this, super impressive!
That sounds really cool. What kind of signal do you have? Is it from a capture card or something else? There is no hsync/vsync checker right now but if the data comes from a capture card it should arrive synchronized. If the input is from a digital media file, it shouldn't be too hard to add it as a channel but you'll need to copy the video data to a framebuffer and for that you can check out the regl video example: https://github.com/regl-project/regl/blob/master/example/video.js
You can then set up a tv channel as standalone regl demo similar to the vhs demo:
- https://github.com/substack/analog-tv-simulation/blob/main/draw/vhs.js
- https://github.com/substack/analog-tv-simulation/blob/main/main.js#L378-L383
- https://github.com/substack/analog-tv-simulation/blob/main/main.js#L243
I was planning on using media files, but a capture card would be super cool too, maybe from a webcam, turn it into a legit broadcast.
I'll check out the regl example you linked, I definitely am learning as I go, webgl is still pretty new to me 😅