Long-exposure photography compared to image-stacking video frames (ImageMagick/FFmpeg)



Pictured above: comparisons of images made from a segment on "Good Mythical Morning" involving "light painting". In the top-left, a 30-second exposure from a still-camera in the studio. Below it, an image made using ImageMagick's '-evaluate-sequence' function, on all frames taken from the 30 seconds of video. In this case, the 'max' setting was used, which stacks maximum pixel values. In the top-right, a single frame from the video, and below it, 100-frames stacked with FFmpeg using sequential 'tblend' filters.

# ImageMagick - Use with extracted frames or FFmpeg image pipe (limited to 4GB)
 convert -limit memory 4GB frames/*.png -evaluate-sequence max merged-frames.png

# FFmpeg - Chain of tblend filters (N.B. inefficient - better ways to do this)
ffmpeg -i video.mp4 -vf tblend=all_mode=lighten,tblend=all_mode=lighten,... 
As a comparison, here is an image made from the same frames but using 'mean' average with ImageMagick.



A video demo for the FFmpeg version


source video: https://www.youtube.com/watch?v=1tdKZYT4YLY&t=2m4s

FFmpeg: Generate an image of tiled results from all 'blend' filter types



Two rudimentary bash scripts, which take two file paths as input for an FFmpeg instance, which in turn uses these files as sources for 'blend' filters. Image dimensions are irrelevant as both input images are scaled to '320x320' (for ease of formatting). Multiple for-loops generate the bulk of the filtergraph. There are more elegant ways of doing this, using multiple outputs and secondary applications, but these solutions here are based on a single instance of FFmpeg.

Note the "$format" variable in the scripts. Different pixel formats will produce different results, which is part of the reason why these scripts do not produce "all possible blend results".

There are two versions: one outputs "all_mode" only results [image above], and the other outputs the results of all blend modes. The "all_mode" only version is probably the more useful of the two. Even if neither script is used, the image examples included here could be useful as references, as they give a general idea of the effect of each 'blend' type.

script: ffmpeg-tiled-blend-results-all_mode-only.sh
script: ffmpeg-tiled-blend-results.sh

The scripts were written to aid with choosing the most suitable blend filter for tasks/projects, which can sometimes be hard to comprehend beforehand. The images produced allow for quick a assessment of possibilities between two test frames.



Input A source: https://www.flickr.com/photos/38983646@N06/15545146285/
Input B source: https://www.flickr.com/photos/archer10/4244381931/