Timelapse/Processing: Difference between revisions
From charlesreid1
| Line 5: | Line 5: | ||
The procedure for post-processing videos looks like this: | The procedure for post-processing videos looks like this: | ||
* Obtain and wrangle a large number of sequentially numbered jpeg files (xargs) | * Obtain and wrangle a large number of sequentially numbered jpeg files (xargs) | ||
* Turn mass of jpeg files into video (ffmpeg) | |||
* Figure out what effects to apply - single jpeg file (lightroom) | * Figure out what effects to apply - single jpeg file (lightroom) | ||
* Apply desired effects en-masse - all jpeg files (lightroom) | * Apply desired effects en-masse - all jpeg files (lightroom) | ||
* | * Make more videos (ffmpeg) | ||
==Tools== | ==Tools== | ||
Revision as of 22:34, 30 July 2016
Overview
Procedure
The procedure for post-processing videos looks like this:
- Obtain and wrangle a large number of sequentially numbered jpeg files (xargs)
- Turn mass of jpeg files into video (ffmpeg)
- Figure out what effects to apply - single jpeg file (lightroom)
- Apply desired effects en-masse - all jpeg files (lightroom)
- Make more videos (ffmpeg)
Tools
ffmpeg: One of the most useful tools for post-processing video is ffmpeg. There are some notes on ffmpeg on the wiki already: Ffmpeg. Most of the material here will be a variation on that.
xargs: Another useful tool for post-processing video is xargs. Notes on xargs on the wiki already: Xargs. This is a unix command-line utility that forks a single process or single command to multiple inputs. This is extremely useful to streamlining image processing, which can be done in parallel. (It is also useful for mass-renaming files.)
ImageMagick: the command-line "convert" tool is the interface for Image Magick, and this is an extremely handy tool if you need to do any mass-manipulation of images from the command line - for example, shrinking, cropping, stretching, filtering, masking, sharpening, blurring. You name it, you can probably do it with ImageMagick. When combined with convert and xargs, you become unstoppable.
There are also some interesting side topics, such as image averaging using the Python_Imaging_Library. This allows for smoother, more stretched-out timelapse videos.
Wrangling Large Numbers of Files
When I finished with my first timelapse, I was left with 16,636 jpg files over an approximately 9 hour period. At around 200 KB a pop, that's a lot of disk space.
Because this would be a really slow timelapse, I didn't want to utilize all of these photographs. So, I also needed a way to figure out the numbering format/schema for this system, and a way to pick which photos would be shown when.
That way, when I have a frequency of "every 2 seconds," I can switch to a different frequency multiple (10 seconds) and see what results. Or, increase fps. Or, whatever.
Applying Effects
Single photo
En masse
Creating Video from Image Files
These notes are based on the notes at the Ffmpeg page.
Renaming Files
One of the quirks of ffmpeg is that, if you are converting a large number of files, they have to be sequentially numbered, STATING WITH 0 OR 1.
If you have sequentially-numbered images but they do not start with 0 or 1, you have two choices:
- Hack it - create multiple copies of the very first frame, and back-number them until they go to 1.
- Be more sophisticated - list all files in order, then append a _1, _2, _3, etc.