Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- fname=$(zenity --entry --text="Name")
- slop=$(slop -f "%x %y %w %h %g %i") || exit 1
- read -r X Y W H G ID < <(echo $slop)
- ffmpeg -f x11grab -s "$W"x"$H" -framerate 24 -i :0.0+$X,$Y ~/Videos/"$fname".mp4
- trimLength=$(bc <<< $(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ~/Videos/"$fname".mp4)-2)
- ffmpeg -t "$trimLength" -i ~/Videos/"$fname".mp4 -filter_complex 'fps=24,scale=640:-1:flags=lanczos,split [o1] [o2];[o1] palettegen [p]; [o2] fifo [o3];[o3] [p] paletteuse' ~/Videos/"$fname".gif
- rm ~/Videos/"$fname".mp4
- notify-send "GIF generation complete"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement