Skip to content

Commit

Permalink
update screencast shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
luozengbin committed Jul 6, 2014
1 parent ee96b03 commit 6ca5065
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion bin/fsc.sh → bin/fsc-window.sh
Expand Up @@ -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]+')
Expand Down
25 changes: 19 additions & 6 deletions site-start.d/init_video.el
Expand Up @@ -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")

Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 6ca5065

Please sign in to comment.