Created
October 13, 2014 00:01
-
-
Save unstabler/aad1161d3a50c38d42dc to your computer and use it in GitHub Desktop.
ffmpeg x11grab를 이용한 스크린 캡쳐
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 | |
OUTFILE=$1 | |
if [ -z $OUTFILE ] | |
then | |
OUTFILE='out.mp4' | |
fi | |
XWININFO=$(xwininfo -frame) | |
WINDOW_RES=$(echo $XWININFO | perl -ne 'print $1 if /geometry\s+(\d+x\d+)/') | |
CORNERS=$(echo $XWININFO | perl -ne 'print "$1,$2" if /Corners:\s+([+]\d+)([+]\d+)/') | |
ffmpeg -y -f alsa -i pulse -f x11grab -s "$WINDOW_RES" -i ":0.0$CORNERS" -r 60 \ | |
-vcodec libx264 -preset ultrafast -crf 18 -acodec libmp3lame -b:a 160k "$OUTFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment