SHARE
TWEET

Untitled

a guest Aug 12th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. # Grab a window with xwininfo
  3. printf "Select a window to record\n"
  4. win_info=$(xwininfo)
  5.  
  6. # Parse xwininfo output into usable parameters.
  7. win_x=$(echo $win_info|sed -e "s/.*Absolute upper-left X: //;s/\ .*//")
  8. win_y=$(echo $win_info|sed -e "s/.*Absolute upper-left Y: //;s/\ .*//")
  9. win_w=$(echo $win_info|sed -e "s/.*Width: //;s/\ .*//")
  10. win_h=$(echo $win_info|sed -e "s/.*Height: //;s/\ .*//")
  11. win_s=$win_w"x"$win_h
  12.  
  13. printf "Sleeping for 15 seconds before recording...\n"
  14. sleep 15
  15.  
  16. # Execute ffmpeg.
  17. ffmpeg \
  18.   -f alsa -i card2 \
  19.   -f x11grab -r 30 -s $win_s -i $DISPLAY+$win_x,$win_y \
  20.   -acodec pcm_s16le -ac 2 \
  21.   -sameq -r 30 -s $win_s \
  22.   $1
RAW Paste Data
Top