From 9e738cd1a4374c4ea3d78b5ae5b1d4729a1313bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= Date: Mon, 16 Apr 2012 19:54:50 +0200 Subject: [PATCH] La til et enkelt ffmpeg-screencast-script. --- ffmpeg-grab-window-with-sound.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 ffmpeg-grab-window-with-sound.bash diff --git a/ffmpeg-grab-window-with-sound.bash b/ffmpeg-grab-window-with-sound.bash new file mode 100755 index 0000000..49ea1e1 --- /dev/null +++ b/ffmpeg-grab-window-with-sound.bash @@ -0,0 +1,10 @@ +#!/bin/bash + +INFO=$(xwininfo -frame) + +WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+') +WIN_XY=$(echo $INFO | grep -oEe 'Corners: \+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/') +WIN_X=$(echo $WIN_GEO | cut -d "x" -f 1 | awk '{print $1+$1%2}') +WIN_Y=$(echo $WIN_GEO | cut -d "x" -f 2 | awk '{print $1+$1%2}') + +ffmpeg -f alsa -ac 1 -i pulse -f x11grab -r 30 -s ${WIN_X}x${WIN_Y} -i :0.0+${WIN_XY} -vcodec libx264 -vpre lossless_ultrafast -acodec libmp3lame ${HOME}/screencast-$(date +%F-%H-%M-%S).mkv -- 2.30.2