Skip to content

Instantly share code, notes, and snippets.

@dyazincahya dyazincahya/ffmpeg.md forked from alexellis/timelapse.md
Last active Feb 11, 2019

Embed
What would you like to do?
Create timelapse and add watermark with ffmpeg

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

my ex : ffmpeg -r 24 -pattern_type glob -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

Add the following after -vcodec libx264 to achieve better quality output

-crf 18 -preset slow

Bulk convert JPGs to 1920x1080, centered

convert input.jpg -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' output.jpg

@dyazincahya

This comment has been minimized.

Copy link
Owner Author

commented Feb 10, 2019

my ex : ffmpeg -r 24 -pattern_type glob -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4

@dyazincahya

This comment has been minimized.

Copy link
Owner Author

commented Feb 11, 2019

add watermark in bottom left :
ffmpeg -i timelapse.mp4 -i watermark.png -filter_complex "overlay=10:main_h-overlay_h-10" output.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.