Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Grab a window with xwininfo
- printf "Select a window to record\n"
- win_info=$(xwininfo)
- # Parse xwininfo output into usable parameters.
- win_x=$(echo $win_info|sed -e "s/.*Absolute upper-left X: //;s/\ .*//")
- win_y=$(echo $win_info|sed -e "s/.*Absolute upper-left Y: //;s/\ .*//")
- win_w=$(echo $win_info|sed -e "s/.*Width: //;s/\ .*//")
- win_h=$(echo $win_info|sed -e "s/.*Height: //;s/\ .*//")
- win_s=$win_w"x"$win_h
- printf "Sleeping for 15 seconds before recording...\n"
- sleep 15
- # Execute ffmpeg.
- ffmpeg \
- -f alsa -i card2 \
- -f x11grab -r 30 -s $win_s -i $DISPLAY+$win_x,$win_y \
- -acodec pcm_s16le -ac 2 \
- -sameq -r 30 -s $win_s \
- $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement