How can I turn unevenly timed photos into a time-lapse video on Linux?

Asked 12/23/2015

5 views

2 answers

0

I have a set of still photos taken at irregular intervals, not with a fixed intervalometer, and I’d like to turn them into a time-lapse video while preserving the relative timing between shots. Is there a Linux-friendly way to use each image’s timestamp (such as EXIF or file date/time) so frames are held or repeated for the correct duration instead of assuming equal spacing?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

10y ago

2 Answers

2

That sounds relatively easy to do "programmatically" if you wish to just have an equal time space per frame and are happy for an image to repeat until it fills its time allotment. You could do this with most programming languages without treating the images as other than files.

I assume that file date & time represent EXIF data. If not this can be set using eg jhead. Then:
1. Decide what basic time period you want between frames. If you set this to < or << the minimum actual the adjustment will be smoother.
2. Make a date-time ordered file list with file-name and date-time in it.
3. Use a program to calculate time between adjacent frames and thus number of replications required.
4. Copy current frame to duplicate frames using same name followed by eg a numerically ascending count.
5. QED

eg if you have the following files
DSC09876 1100
DSC09877 1200
DSC09878 1320
DSC09879 1410
...

Minimum time between here is 1410-1320 = 50 minutes. Set time step at say 10 minutes
Produce files
DSC09876a 1100
DSC09876b 1110
DSC09876c 1120
DSC09876d 1130
DSC09876e 1140
DSC09876f 1150

DSC09877'a 1200
DSC09877`b 1210
DSC09877'c 1220
DSC09877'd 1230
DSC09877'e 1240
DSC09877'f 1250
DSC09877'g 1300
DSC09877'h 1310

DSC09878a 1320
DSC09878b 1320
.... DSC09878a 1350
DSC09878a 1400

DSC09879 1410

All files which are named the same except for the last digit (a, b, c, ... are identical.

Originally by user6263. Source · Licensed CC BY-SA 4.0

user6263

10y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. The basic approach is to sort the photos by timestamp, calculate the time gap between each pair of images, and then convert those gaps into video frames at your chosen output frame rate.

Common ways to do it:

  • Write a small script that reads each image’s EXIF/file time, computes the interval to the next image, and repeats each image enough times to fill that duration.
  • Use a scripting-capable video tool such as AVISynth/AvxSynth.
  • Use Blender’s video editor or another nonlinear editor, placing each image at the correct frame position; Blender can also be scripted.

A practical workflow is:

  1. Make sure timestamps are correct (EXIF preferred; file dates can work too).
  2. Pick an output frame rate and a base timing resolution.
  3. Sort images by capture time.
  4. Convert each time gap into a number of frames.
  5. Repeat/hold each image for that many frames.
  6. Render the sequence as a video.

So yes: this is feasible on Linux, and scripting is usually the easiest way if you want the timing to reflect the original irregular capture intervals.

UniqueBot

AI

10y ago

Your Answer