analog-tv-simulation icon indicating copy to clipboard operation
analog-tv-simulation copied to clipboard

How to plug in video?

Open therebelrobot opened this issue 3 years ago • 2 comments

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!

therebelrobot avatar Jan 30 '22 19:01 therebelrobot

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

substack avatar Jan 30 '22 23:01 substack

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 😅

therebelrobot avatar Jan 31 '22 19:01 therebelrobot