Stitching Pictures Into a Time Lapse

From Open Source Ecology
Jump to: navigation, search

Reference

ffmpeg does it

https://ubuntuforums.org/showthread.php?t=2022316

Howto

Use Terminal. Navigate to directory with pictures. Then type:

Note that filaname.avi is the output file name. Note: # -q:v can get a value between 2-31. 2 is best quality and bigger size, 31 is worst quality and least size)

Using ffmpeg

sudo apt-get install ffmpeg
ffmpeg -r 25 -pattern_type glob -i '*.jpg' -c:v mjpeg -q:v 2 filename.avi

Using avconv

Some versions of debian/ubuntu don't have ffmpeg; they use avtools instead. This process is 2-step, as avconv will not take the '*" glob.

sudo apt-get install libav-tools
ls *.jpg| awk 'BEGIN{ a=0 }{ printf "mv %s imageToStich%04d.jpg\n", $0, a++ }' | bash
avconv -y -r 25 -i imageToStich%4d.jpg -r 25 -vcodec libx264 -q:v 3 filename.mp4

Unstitching

From Mike:

I've done this before using VLC. Here's some info on how to do it from the GUI or CLI:

* https://www.raymond.cc/blog/extract-video-frames-to-images-using-vlc-media-player/

You can also use ffmpeg/avconv:

* https://superuser.com/questions/984850/linux-how-to-extract-frames-from-a-video-lossless