Skip to content

Instantly share code, notes, and snippets.

@swyngaard
Last active November 23, 2023 11:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swyngaard/9c628d24a776e67f656670cb68531e5f to your computer and use it in GitHub Desktop.
Save swyngaard/9c628d24a776e67f656670cb68531e5f to your computer and use it in GitHub Desktop.
FFMPEG record desktop at 60 frames per second
Install ffmpeg or libav-tools.
Change -video_size to match your desktop resolution.
Record your desktop by executing the script:
./record.sh
Record without audio as follows:
./record_no_audio.sh
The output file will be generated in your $HOME directory. It will be a timestamped file with the suffix "_output.mp4", e.g. 105221022017_output.mp4
#!/bin/bash
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0 -f pulse -ac 2 -i default -c:v libx264 -pix_fmt yuv420p -c:a ac3 -ab 320k $HOME/`date +%H%M%d%m%Y`_output.mp4
#!/bin/bash
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0 -c:v libx264 -pix_fmt yuv420p $HOME/`date +%H%M%d%m%Y`_output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment