SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. # NAME
  4. #   record-screen - script for recording your screen with FFmpeg!
  5. #
  6. # SYNOPSIS
  7. #   ./record-screen [FILE]
  8. #
  9. # NOTES
  10. #   • This script assumes that you are using a recent NVIDIA GPU and that you
  11. #     want to be recording lossless HVEC/H.265 video.
  12. #
  13. #   • Please note that this will likely only work reliably with single-monitor
  14. #     setups...  Otherwise it picks the first 'connected' monitor from xrandr's
  15. #     list...
  16. #
  17. #   • If you are downloading this from a GitHub Gist, be sure to 'chmod +x' this
  18. #     script before attempting to run it!
  19. #
  20. # TODO
  21. #   • Add support for other encoding schemes and acceleration.
  22.  
  23. resolution="$( xrandr \
  24.                 | grep -w connected \
  25.                 | awk -F'[ \+]' '{print $3}' 2> /dev/null \
  26.                 | head -n1 \
  27.              )"
  28.  
  29. ffmpeg -video_size $resolution \
  30.        -analyzeduration 2048M \
  31.        -probesize 2048M \
  32.        -framerate 60 \
  33.        -f x11grab \
  34.        -i :0.0 \
  35.        -c:v hevc_nvenc -preset lossless -threads 0 \
  36.    "$1" \
  37. ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top