vydd / sketch

A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer graphics, exploration of human-computer interaction, and more.
MIT License
1.4k stars 67 forks source link

Video support? #163

Open kflak opened 7 months ago

kflak commented 7 months ago

Hi,

I'm dipping my toes into the lisp waters (again) and wondering if there's any way to get video input/playback working with sketch? I'm on Arch Linux.

Kevinpgalligan commented 7 months ago

Not currently, no. I've been looking to add support for saving a video recording of a sketch, but haven't gotten around to it yet. Dunno what it would take to be able to play videos in a sketch -- from what I can tell, the support for video is lacking in the CL ecosystem.

Kevinpgalligan commented 7 months ago

These are the currently supported resource types:

((:png :jpg :jpeg :tga :gif :bmp) :image)
  ((:ttf :otf) :typeface))

A workaround would be to use a gif, or dump the frames of your video as PNG files and cycle through them.

kflak commented 7 months ago

Thanks! I am looking at doing live video processing of a webcam, which would be tricky to do with that approach (although there might be some way to get around it with ffmpeg/v4l2...?). For video files the frame dump option could be plausible. I guess that's what processing and openFrameworks does when it comes down to it: displaying one image after another... Although that approach would still need some way to make sure that the video playback is happening at the right speed.

Kevinpgalligan commented 7 months ago

Yeah, maybe it could work with ffmpeg/v4l2, though I don't have experience with those and don't know if there would be an efficient way to dump their output into Sketch's OpenGL buffers.