Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.