diff --git a/bin/fsc-full.sh b/bin/fsc-full.sh new file mode 100755 index 0000000..ec38b58 --- /dev/null +++ b/bin/fsc-full.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +WIN_GEO=$(xwininfo -root | grep 'geometry' | awk '{print $2;}' | cut -d '+' -f 1) + +# 録画開始 +ffmpeg -show_region 1 -f x11grab -framerate 25 -video_size $WIN_GEO -i :0.0 -dcodec copy -pix_fmt yuv420p -c:v libx264 -preset veryfast -qscale 1 -y $1 diff --git a/bin/fsc.sh b/bin/fsc-window.sh similarity index 91% rename from bin/fsc.sh rename to bin/fsc-window.sh index cac91e3..c50cc06 100755 --- a/bin/fsc.sh +++ b/bin/fsc-window.sh @@ -8,7 +8,7 @@ function even_round { fi } -echo "録画対象Windowをカーソルで選択してください。" +echo "\n録画対象Windowをカーソルで選択してください。" INFO=$(xwininfo -frame) WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+') diff --git a/site-start.d/init_video.el b/site-start.d/init_video.el index 7b53284..0da6f81 100644 --- a/site-start.d/init_video.el +++ b/site-start.d/init_video.el @@ -24,10 +24,15 @@ ;;; Code: -(defvar record-program +(defvar record-win-program (concat - user-emacs-directory "bin/fsc.sh") - "program for recode video") + user-emacs-directory "bin/fsc-window.sh") + "program for recode window video") + +(defvar record-full-program + (concat + user-emacs-directory "bin/fsc-full.sh") + "program for recode full screen video") (defvar screencast-buffer "*Screencast*" "buffer name for screencast process") @@ -36,8 +41,17 @@ ;;; popupバッファで表示する (push `(,screencast-buffer) popwin:special-display-config) -(defun my-screencast (file) +(defun my-screencast-full (file) (interactive "FSave Screencast File: ") + (my-screencast record-full-program file) + (message "Screencast Start!")) + +(defun my-screencast-win (file) + (interactive "FSave Screencast File: ") + (my-screencast record-win-program file) + (message "録画対象Windowをカーソルで選択してください。")) + +(defun my-screencast (record-program file) (let* ((screencast-file (expand-file-name file)) (proc (start-process "my-screencast" screencast-buffer record-program @@ -46,8 +60,7 @@ (with-current-buffer screencast-buffer (setq buffer-read-only t) (screencast-mode) - (set (make-local-variable 'screencast-file) screencast-file)) - (display-buffer screencast-buffer))) + (set (make-local-variable 'screencast-file) screencast-file)))) (defun my-screencast-stop () (interactive)