Advertisement
devinteske

vizvfs.sh

Apr 15th, 2018
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 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 15 --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. PROBE=vop_create,vop_lookup,vop_mkdir,vop_mknod,vop_remove,vop_rmdir,vop_symlink
  14. ssh "$@" dwatch -FX vop_create $PROBE | awk '
  15.     (execname = $6) && sub(/\[[[:digit:]]+\]:$/, "", execname) {
  16.         (cmd = sprintf("date -jf \"%s\" \"%s\" +%%s", "%Y %b %e %T",
  17.             datetime = substr($0, 1, 20))) | getline epoch
  18.         close(cmd)
  19.         if ((probe = $8) ~ /remove|rm/)
  20.             type = "D"
  21.         else if (probe ~ /lookup/)
  22.             type = "M"
  23.         else
  24.             type = "A"
  25.         sub(/.*:entry /, "")
  26.         printf "%s|%s|%s|%s\n", epoch, execname, type, (path = $0)
  27.     }
  28. ' | gource $GOURCE_OPTIONS - | ffmpeg $FFMPEG_OPTIONS "${pgm%.*}.mp4"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement