4 ms·
I did something similar by piping ffmpeg into a numpy array, with each frame updating the average RGB value of each pixel in the array. Here's a three-second c
by flashman 9y ago
I did something similar by piping ffmpeg into a numpy array, with each frame updating the average RGB value of each pixel in the array.
Here's a three-second clip from 'Logan' of a scene where Hugh Jackman's character is leaping through the air from right to left: http://i.imgur.com/EIp56LX.jpg http://i.imgur.com/EIp56LX.jpg
I like the results better for short sequences, but here's the entirety of 'Logan' (not sure what's causing the dark line down the middle): http://i.imgur.com/3QW6zPj.jpg http://i.imgur.com/3QW6zPj.jpg
- kevin_thibedeau 9y ago> not sure what's causing the dark line down the middle Watermark?
- flashman 9y agoNot a watermark. But I did it on a 240p version of the file (much much faster processing speed), probably has something to do with it.
- pasta 9y agoI use this with my crappy webcam. The long 'exposure' fixes noise so it can also take nice pictures when there is no much light. The same technique is also used in 3D path tracers. You sample a pixel multiple times to reduce noise.
- bananasbandanas 9y agoWould you mind sharing the code? I find the second example oddly satisfying to look at and would like to experiment with other movies at different resolutions.
- flashman 9y agoHere's my code: https://gist.github.com/timbennett/9c1614281797ce620c6069476d39c7b8 https://gist.github.com/timbennett/9c1614281797ce620c6069476... You'll need to experiment to find the right value for the variable 'alpha' in the script. This controls each frame's opacity: too high and it will be overexposed, too low and it will be dark. It's roughly in the range 5/n to 40/n where n is the number of frames in the video, but depends on the film's overall moodiness too. If you're going to run it on a feature film length video, I suggest making a low-resolution version (e.g. 144p) and fine-tuning alpha on that, since it will be significantly less frustrating.
- bananasbandanas 9y agoThanks!