Created
February 26, 2017 02:02
-
-
Save baitisj/0cdb59ec53488b1b8dec85c4c29de660 to your computer and use it in GitHub Desktop.
Click on a window to perform screen grab at 5 FPS
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 | |
echo "Click on a window to record." | |
properties=`xwininfo | grep ":"` | |
width=`echo "$properties" | grep "Width: " | tr -d '[:space:]' | cut -d ':' -f 2` | |
height=`echo "$properties" | grep "Height: " | tr -d '[:space:]' | cut -d ':' -f 2` | |
ulx=`echo "$properties" | grep "Absolute upper-left X:" | tr -d '[:space:]' | cut -d ':' -f 2` | |
uly=`echo "$properties" | grep "Absolute upper-left Y:" | tr -d '[:space:]' | cut -d ':' -f 2` | |
ffmpeg -loglevel quiet -f x11grab \ | |
-framerate 5 \ | |
-video_size ${width}x${height} \ | |
-i :0.0+${ulx},${uly} \ | |
-vcodec libx264 \ | |
-qp 0 \ | |
-preset ultrafast \ | |
/var/tmp/output.mkv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment