Advertisement
devinteske

vizopen.sh

Apr 14th, 2018
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None | 0 0
  1. #!/bin/sh
  2. pgm="${0##*/}" # Program basename
  3. [ $# -gt 0 ] || { echo "Usage: $pgm [ssh_options] ssh_host" >&2; exit 1; }
  4. GOURCE_OPTIONS="
  5.     --1280x800 --auto-skip-seconds 1 --bloom-intensity 0.25
  6.     --file-idle-time 2 --highlight-users --key --log-format custom
  7.     --output-ppm-stream - --seconds-per-day 0.01
  8. " # END-QUOTE
  9. FFMPEG_OPTIONS="
  10.     -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264
  11.     -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0
  12. " # END-QUOTE
  13. ssh "$@" dwatch -X open | awk 'sub(/\[.*\]:/, "|", $6) {
  14.     (cmd = sprintf("date -jf \"%s\" \"%s\" +\"%%s|\"", "%Y %b %e %T",
  15.         datetime = substr($0, 1, 20))) | getline epoch
  16.     close(cmd)
  17.     execname = $6
  18.     sub(/.*\| /, "M|")
  19.     print epoch execname (path = $0)
  20. }' | gource $GOURCE_OPTIONS - | ffmpeg $FFMPEG_OPTIONS "${pgm%.*}.mp4"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement