Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertVeli committed Oct 5, 2011
0 parents commit 728b05d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Shell script to calculate coordinates
of an X11 window and then call ffmpeg
to record screencast with those coordinates.

Press q or Ctrl-C to stop recording.

The resulting mkv file kan be converted to some other
format again using ffmpeg. For instance:

ffmpeg -i output.mkv -sameq -an output.avi

21 changes: 21 additions & 0 deletions record_object.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

if ! which xwininfo >/dev/null; then
echo "install xwininfo first"
fi

if ! which ffmpeg >/dev/null; then
echo "install ffmpeg first"
fi

txt=`xwininfo`

corner=`echo $txt | sed 's/^.*Corners://' | awk '{print $1}' | sed 's/\(+[0-9]*\)+/\1,/'`

width=`echo $txt | sed 's/^.*Width://' | awk '{print $1}'`
height=`echo $txt | sed 's/^.*Height://' | awk '{print $1}'`

read -p "Window is ${width}x${height}, continue (y/n)? "
[ "$REPLY" == "y" ] || exit 1

ffmpeg -f x11grab -r 25 -s ${width}x${height} -i :0.0${corner} -an -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv

0 comments on commit 728b05d

Please sign in to comment.