Timelapse Video: Unterschied zwischen den Versionen
Daniel (Diskussion | Beiträge) K (1 Version importiert) |
|
(kein Unterschied)
|
Aktuelle Version vom 21. Oktober 2021, 06:18 Uhr
Die kurze Variante, welche die Bilder in der Originalauflösung lässt https://superuser.com/questions/624567/how-to-create-a-video-from-images-using-ffmpeg 1fps
cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4
3fps
cat *.jpg | ffmpeg -f image2pipe -r 3 -vcodec mjpeg -i - -vcodec libx264 out.mp4
test
cat *.jpg | ffmpeg -vf scale=1920:1440,crop=1920:1080 image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4
First we rename all *.JPG files based on their creation date. Sometimes cameras change the file name or just ordering them is somehow not what we want. However, renaming them by the creation date always work:
jhead -n%Y%m%d-%H%M%S *.JPG
After that we put this list in a file:
ls -1tr | grep -v files.txt > files.txt
And then use mencoder to create an AVI video using 20 fps. Note that this will generate a huge video file, usually around the same size of all the pictures summed.
mencoder -nosound -noskip -oac copy -ovc copy -o output.avi -mf fps=20 'mf://@files.txt'
I usually take pictures for timelapse with the lowest resolution of my camera (5 MP), which has a 4:3 aspec ratio. To generate a proper 1080p video the image is first re-scalled to 1920 pixels of width and then I crop it to 1080 of height. This way I am not changing the photos' content, just cropping:
ffmpeg -i output.avi -y -vf scale=1920:1440,crop=1920:1080 output-final.avi
The reason I use mencoder to put the photos together is because I got a segmentation fault with ffmpeg.