Since yesterday’s post I’ve spent a lot more time beating on my video averaging script. Actually, I rewrote the thing from scratch, and it’s looking pretty good. For my second proof-of-concept (above) I used all 28 Ask a Ninja videos available on Revver. Thanks to the fine folks in #ffmpeg on Freenode, I managed to really speed up the video capture portion of the script. This time I went for 800×600 and captured a frame every 20 seconds. Capturing 272 frames from almost four hours of video took six and a half minutes and averaging them took just over four minutes. Once again, I tweaked the contrast of the final image a bit.
The real bottleneck in the process is memory. Read the rest of this entry »
I killed most of the afternoon writing a Ruby script that takes a directory full of video files, goes through them one at a time plucking out a frame every X seconds, and then averages the frames into a single image. My guinea pig? lonelygirl15. The YouTube-ingenue-who-might-be-a-hoax seemed like an easy target for some deep metaphor about synthetic art or art imitating life imitating art or something, but that’s a metaphysical rabbit hole I don’t really have the energy for today. It’s left as an exercise for the reader.
The technical details I can handle, however: The above image is a mathematical average of 25 videos (all of lonelygirl15’s videos to date except the first two, which you might consider “non-canon”) which total about 49 minutes. One frame was taken every 15 seconds, for a total of 209 frames. The script is about 75 lines of Ruby code, but the real heavy lifting is done by the spectacular RMagick and FFmpeg (sadly, there were no rmovie binaries available for Windows, so I had to talk to the command line). After the script grabbed the frames and averaged them, all I did was up the contrast a bit in Paint Shop Pro.
The script is theoretically limited only by memory and processor cycles. The image above took six or seven minutes to “render,” about half of which was capturing the frames, but the averaging itself ate up pretty much all of my memory, so working with more frames or higher resolution captures would require a bigger commitment, or at least a spare Linux box (working on that).
To be perfectly clear, I’m not at all the first person to do this sort of thing. Jason Salavon has done it with Playboy centerfolds, real estate, talk show hosts, and even porn, and Meggan Gould has averaged the results of Google Images searches to fascinating effect.