Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ffmpeg=$(which ffmpeg)
- fps=25
- # Get the coordinates of the active window's
- # top-left corner, and the window's size.
- # This excludes the window decoration.
- unset x y w h
- eval $(xwininfo -name FlightGear |
- sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
- -e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
- -e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
- -e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )
- echo -n "$x $y $w $h"
- #
- # Get the window resolution
- window=$(xwininfo -name FlightGear| grep 'geometry' | awk '{print $2;}' | sed 's/+\(.*\)//')
- # Start the recording
- $ffmpeg -f x11grab -s $window -r $fps -i :0.0+$x,$y -sameq $1
Add Comment
Please, Sign In to add comment