Skip to content

Instantly share code, notes, and snippets.

@ToshY
Last active March 2, 2021 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToshY/38107d8edb0b6f74d60793c9a8bd3b5a to your computer and use it in GitHub Desktop.
Save ToshY/38107d8edb0b6f74d60793c9a8bd3b5a to your computer and use it in GitHub Desktop.
FFmpeg MP4 to WebP 10 second 24FPS fragment
ffmpeg -i "input.mp4" -vcodec libwebp -filter:v fps=fps=23.976 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 320:180 -ss 00:00:15 -t 00:00:10 "output.webp"
@ToshY
Copy link
Author

ToshY commented Mar 2, 2021

Starting at 20 seconds, every 7 minutes, create a 3 second segment with 23.976 FPS, scaled to 720:-2 (keep aspect ratio).

ffmpeg -ss 20 -i "input.mp4" -vcodec libwebp -vf "select='lt(mod(t,60*7),3)',setpts=N/FRAME_RATE/TB,fps=23.976,scale='720:-2:flags=lanczos'" -quality 85 -loop 0 -preset icon -an -vsync 0 "output.webp"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment