Guest User

Untitled

a guest
Sep 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.57 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Recibe como argumento el nombre del archivo de salida (video)
  4.  
  5. FPS=25
  6. FILE=/tmp/winprop.tmp
  7.  
  8. xwininfo >> $FILE 2>/dev/null
  9.  
  10. X=$(grep 'Absolute upper-left X:' $FILE | awk '{print $4}');
  11. Y=$(grep 'Absolute upper-left Y:' $FILE | awk '{print $4}');
  12. WIDTH=$(grep 'Width:' $FILE | awk '{print $2}');
  13. HEIGHT=$(grep 'Height:' $FILE | awk '{print $2}');
  14.  
  15. POS="${X},${Y}"
  16. SIZE="${WIDTH}x${HEIGHT}"
  17. echo ${POS};
  18.  
  19. rm $FILE
  20.  
  21. #haces que ffmpeg capture solo una ventana
  22. ffmpeg -f x11grab \
  23.  -r ${FPS} \
  24.  -s ${SIZE} \
  25.  -i ${DISPLAY}+${POS} \
  26.  -sameq \
  27.  $1
Add Comment
Please, Sign In to add comment