Create time lapse video from images

From WickyWiki
Revision as of 16:04, 15 March 2019 by Wilbert (talk | contribs) (Created page with "Category:Ubuntu Category:Ubuntu Images Category:Ubuntu Video Category:201903 Install ffmpeg: <syntaxhighlight lang=bash> sudo apt install ffmpeg </syntaxhig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Install ffmpeg:

sudo apt install ffmpeg

Create timelapse file-index

Format:

 file '/full/path/to/file1.jpg'
 file '/full/path/to/file2.jpg'
 ...

Create:

sourcedir=$HOME/Pictures/timelapse
find "${sourcedir}" -iname "*.jpg" -type f | sort | sed "s/\(.*\)/file '\1'/g"  > "${sourcedir}/../files.txt"

Create video:

ffmpeg -f concat -safe 0 -i "${sourcedir}/../files.txt" -r 25 -vcodec libx264 -crf 22 "${sourcedir}/../out.mp4"