Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2. fname=$(zenity --entry --text="Name")
  3. slop=$(slop -f "%x %y %w %h %g %i") || exit 1
  4. read -r X Y W H G ID < <(echo $slop)
  5. ffmpeg -f x11grab -s "$W"x"$H" -framerate 24 -i :0.0+$X,$Y ~/Videos/"$fname".mp4
  6. trimLength=$(bc <<< $(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ~/Videos/"$fname".mp4)-2)
  7. 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
  8. rm ~/Videos/"$fname".mp4
  9. notify-send "GIF generation complete"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement