Guest User

Untitled

a guest
Sep 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ffmpeg=$(which ffmpeg)
  4.  
  5. fps=25
  6.  
  7. # Get the coordinates of the active window's
  8. # top-left corner, and the window's size.
  9. # This excludes the window decoration.
  10. unset x y w h
  11. eval $(xwininfo -name FlightGear |
  12. sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
  13. -e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
  14. -e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
  15. -e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )
  16. echo -n "$x $y $w $h"
  17. #
  18.  
  19. # Get the window resolution
  20. window=$(xwininfo -name FlightGear| grep 'geometry' | awk '{print $2;}' | sed 's/+\(.*\)//')
  21.  
  22. # Start the recording
  23. $ffmpeg -f x11grab -s $window -r $fps -i :0.0+$x,$y -sameq $1
Add Comment
Please, Sign In to add comment