Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- pgm="${0##*/}" # Program basename
- [ $# -gt 0 ] || { echo "Usage: $pgm [ssh_options] ssh_host" >&2; exit 1; }
- GOURCE_OPTIONS="
- --1280x800 --auto-skip-seconds 1 --bloom-intensity 0.25
- --file-idle-time 15 --highlight-users --key --log-format custom
- --output-ppm-stream - --seconds-per-day 0.01
- " # END-QUOTE
- FFMPEG_OPTIONS="
- -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264
- -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 \
- " # END-QUOTE
- PROBE=vop_create,vop_lookup,vop_mkdir,vop_mknod,vop_remove,vop_rmdir,vop_symlink
- ssh "$@" dwatch -FX vop_create $PROBE | awk '
- (execname = $6) && sub(/\[[[:digit:]]+\]:$/, "", execname) {
- (cmd = sprintf("date -jf \"%s\" \"%s\" +%%s", "%Y %b %e %T",
- datetime = substr($0, 1, 20))) | getline epoch
- close(cmd)
- if ((probe = $8) ~ /remove|rm/)
- type = "D"
- else if (probe ~ /lookup/)
- type = "M"
- else
- type = "A"
- sub(/.*:entry /, "")
- printf "%s|%s|%s|%s\n", epoch, execname, type, (path = $0)
- }
- ' | gource $GOURCE_OPTIONS - | ffmpeg $FFMPEG_OPTIONS "${pgm%.*}.mp4"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement