Hacker News new | past | comments | ask | show | jobs | submit login
Long Exposures – Creating Average Frames from Movies (shkspr.mobi)
82 points by edent on May 22, 2017 | hide | past | favorite | 19 comments



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

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


Would 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.


Here's my code: 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.


Thanks!


I 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.


> not sure what's causing the dark line down the middle

Watermark?


Not 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.


Different but related. Color of movies by frame: Corrected:

http://thecolorsofmotion.com/films


If you're interested in creating your own: http://timbennett.github.io/movie-barcodes/ (I wrote this, it's not fantastic but it's functional)


You've pasted the same URL.


I wonder how a moving average of a movie would look? I think the trick would be in choosing the right length for the moving average window, so that the viewer could still see the "chapter" transitions.


Related work: The artist Jason Salavon is well-known for making work using a software-driven frame averaging technique. https://en.wikipedia.org/wiki/Jason_Salavon

Using analog techniques there is a famous set of photographs of films playing in movie theaters by Japanese artist Hiroshi Sugimoto. In this work a long duration time-lapse photo of the film renders the screen glowing white with a pale outline of the theatre around it. https://www.sugimotohiroshi.com/new-page-7


Also different but related: slit scan photography.

wikipedia: https://en.wikipedia.org/wiki/Slit-scan_photography

with video: https://www.youtube.com/watch?v=NSesvu_uqLo


Awesome! Here's a similar project in the audio domain:

http://rlukedubois.bandcamp.com/album/timelapse


Cool! I tried something similar using Go + ffmpeg. Eventually wanted to find a way to select the most "continuous" pixel from all available data and spider out, but never got that far. Instead I played around with gifs and space.

[1] https://goo.gl/photos/se5pBWh399JJ945T6 [2] https://theblackbox.ca/blog/vector-video/


With VLC you can add motion blur to your videos in "Video Effects(⌘+E) > Color > Motion Blur", if you push the factor high you get some nice effects.


I have one of Brendan Dawes' CinemaRedux prints on my wall at home. http://www.brendandawes.com/projects/cinemaredux


you can also do some fun stuff with image averaging in ImageJ. here is a python script for ImageJ I wrote a while back that takes the standard deviation of several frames at a time and averages them onto a background (https://pastebin.com/09wPkwhN nb: I am a terrible programmer and this was when I was just starting to learn) that produced this: http://imgur.com/a/eaLEO


At the beginning of the article, there is a set of a 2 rows x 3 column set of images by Jason Schulman. The last imahlge on the first row, looks kind of like a blurry Albert Einstein.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: