Created
June 9, 2017 03:03
-
-
Save huzhifeng/6c327b1d8be63920d27c604fe4497925 to your computer and use it in GitHub Desktop.
Use ffmpeg to capture desktop
This file contains 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 | |
VIDEO_DIR=${HOME}/Videos | |
VIDEO_TIME=`date +'%Y%m%d%H%M%S'` | |
VIDEO_SUFFIX=mkv | |
VIDEO_FILE=${VIDEO_DIR}/${VIDEO_TIME}.${VIDEO_SUFFIX} | |
if [ ! -e ${VIDEO_DIR} ]; then | |
mkdir -p ${VIDEO_DIR} | |
fi | |
DISPLAY_SIZE=`xdpyinfo | grep 'dimensions:' | awk '{print $2}'` | |
echo "Save to ${VIDEO_FILE}" | |
#ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s $DISPLAY_SIZE -r 35 -qscale 1 -i :0.0 ${VIDEO_FILE} | |
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s $DISPLAY_SIZE -r 35 -qscale 1 -t 0:0:10 -i :0.0 ${VIDEO_FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment