Add ffmpeg function to convert video to gif
This commit is contained in:
parent
3c3ed20f8d
commit
3465007ba6
10
.config/scripts/functions/ffmpeg
Normal file
10
.config/scripts/functions/ffmpeg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
function video_to_gif() {
|
||||||
|
if [ "$#" -ne 4 ]; then
|
||||||
|
echo "Usage: video_to_gif input.mp4 output.gif start duration"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
ffmpeg -ss "$3" -t "$4" -i "$1" \
|
||||||
|
-vf "fps=24,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
|
||||||
|
-loop 0 "$2"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user