Created
October 11, 2015 07:46
-
-
Save hhyyrylainen/30a025d8f6055266bfa4 to your computer and use it in GitHub 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 | |
ffmpeg -framerate 25 -video_size 1920x1080 -f x11grab -i :0.0+1920,0 -f alsa -ac 2 -i pulse -vcodec libx264 -crf 0 -preset ultrafast -strict -2 screenrecord.mp4 | |
echo "Re-encoding to use less space" | |
# Find a file name that doesn't exist yet | |
fileending="" | |
if [ -f screenrecord_encoded_$fileending.mp4 ] | |
then | |
fileending="2" | |
while [ -f screenrecord_encoded_$fileending.mp4 ] | |
do | |
fileending=$((fileending + 1)) | |
done | |
fi | |
echo "Encoding final file screenrecord_encoded_$fileending.mp4" | |
ffmpeg -i screenrecord.mp4 -strict -2 screenrecord_encoded_$fileending.mp4 | |
echo "Deleting raw file" | |
rm screenrecord.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment