Skip to content

Instantly share code, notes, and snippets.

@feisuzhu
Last active August 29, 2015 14:16
Show Gist options
  • Save feisuzhu/e27df960af640dc910a9 to your computer and use it in GitHub Desktop.
Save feisuzhu/e27df960af640dc910a9 to your computer and use it in GitHub Desktop.
screencast
#!/bin/bash
if [ "$1" == "" ]; then
ffmpeg -f avfoundation -list_devices true -i ""
echo Choose input device!
exit 1
fi
FILENAME=$(date '+%Y-%m-%d-%H-%M')
ffmpeg -f avfoundation -i 1 -r 1 -vcodec libx264 $FILENAME-slow.mkv
nice ffmpeg -i $FILENAME-slow.mkv -r 24 -filter:v "setpts=0.041666666*PTS" ${FILENAME}.mkv
rm $FILENAME-slow.mkv
#!/bin/bash
RESOLUTION=$(xdpyinfo | grep "dimension" | awk '{print $2}')
FILENAME=$(date '+%Y-%m-%d-%H-%M')
ffmpeg -framerate 1 -s $RESOLUTION -f x11grab -i :0.0 -vcodec libx264 $FILENAME-slow.mkv
nice ffmpeg -i $FILENAME-slow.mkv -r 24 -filter:v "setpts=0.041666666*PTS" ${FILENAME}.mkv
rm $FILENAME-slow.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment