mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Add conversion to GIF
This commit is contained in:
parent
4a22d3db7e
commit
b581ef9912
1 changed files with 20 additions and 0 deletions
20
shell/ffmpeg
Normal file
20
shell/ffmpeg
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function() vid2gif {
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
|
||||
local fps="25" # gif internal = delay in 1/100th s => fps in [100, 50, 33.3, 25, 20, ...]
|
||||
local width="320" # height automatic
|
||||
local loop="0" # -loop $loop : 0 = infinite, -1 = nope, > 0 = play twice or more (play=loop+1)
|
||||
local skip="0" # -ss $skip
|
||||
local length="-1" # -t $length
|
||||
|
||||
# palettegen=stats_mode=single (each frame) | =full (default, whole image) | =diff (moving parts)
|
||||
# paletteuse=new=1 (one palette per frame)
|
||||
# paletteuse=dither=bayer bayer_scale=[0,5] (default 2)
|
||||
# https://ffmpeg.org/ffmpeg-filters.html#palettegen
|
||||
# https://ffmpeg.org/ffmpeg-filters.html#paletteuse
|
||||
|
||||
ffmpeg -i "${src}" -vf "fps=25,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${dst}"
|
||||
}
|
||||
|
||||
# vim: ft=bash
|
||||
Loading…
Add table
Add a link
Reference in a new issue