Created
April 9, 2014 08:17
-
-
Save carlmartus/10240354 to your computer and use it in GitHub Desktop.
Webm capture window with avconv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SCREENRES=1280x1024 | |
BITRATE=1000K | |
FPS=30 | |
TEMP=`mktemp -u` | |
xwininfo > $TEMP | |
WINX=`grep "Absolute upper-left X" $TEMP | awk '{ print $4 }'` | |
WINY=`grep "Absolute upper-left Y" $TEMP | awk '{ print $4 }'` | |
WINW=`grep Width $TEMP | awk '{ print $2 }'` | |
WINH=`grep Height $TEMP | awk '{ print $2 }'` | |
CROPSTR=$WINW:$WINH:$WINX:$WINY | |
TEMPAVI=`mktemp -u`.avi | |
echo "Crop: $CROPSTR" | |
trap 'echo BYE' 2 3 | |
avconv -y -f x11grab -s $SCREENRES -i :0.0 -r $FPS -an -c rawvideo -vf crop=$CROPSTR $TEMPAVI | |
echo "Output: $1" | |
avconv -y -i $TEMPAVI -an -b 800K $1 | |
rm $TEMPAVI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment