4 ms·
Show HN: I Made a Video Looper in Python with ChatGPT in Less Than 1 Hour
This is something I had been wondering about for a while: could ChatGPT help me make a videolooper? I had been assuming Python would be too slow, but I wanted to prove it out.. After about 45 minutes and only 7 iteration, I came up with this working MVP!
I was especially impressed with its suggestion to use OpenCV, but also when I asked it to do multiple video streams at once, and to arrange them in a 2x2 grid, it gracefully added a few lines of numpy calls to stack them up. Next step would be to add audio.
Check out the source here: https://github.com/diydsp/Video-Looper-in-Python https://github.com/diydsp/Video-Looper-in-Python
- zahlman 2y ago> I had been assuming Python would be too slow It likely would be if you had to implement algorithms in Python at the pixel level on Python data structures. The libraries you use do the hard part in C and provide an API to Python. Anyway, I see how this code would multiplex four sources into a 2x2 grid in an output feed - but not how it would loop anything... ?
- chillingeffect 2y agoI believe it's in the playback_frame() function via the % operator.
- zahlman 2y agoAh, I missed that, good catch.