Advertisement
frankjonen

Screen Recording Script

Nov 8th, 2021 (edited)
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #!/bin/sh
  2. # This is macOS focused, on other systems
  3. # you need to change -f avfoundation to
  4. # Linux: x11grab
  5. # Windows: gdigrab  all displays as one
  6. #          dshow    discrete recording
  7.  
  8. # Check for screen to record from via:
  9. # ffmpeg -f avfoundation -list_devices true -i ""
  10. # And set it after -i (my screen is 0)
  11. # To add audio, set the audio device after it
  12. # Example -i (0.1)
  13.  
  14. # Screen recording is ended with CTRL+C
  15. # Script is used as: scriptname filename
  16. # Output is without audio
  17. # To add audio change
  18. # Matroska suffix is added for convenience,
  19. # change it if you like.
  20. # FFMPEG via Homebrew. http://brew.sh
  21.  
  22.  
  23. outfile=$1
  24.  
  25. ffmpeg  -video_size 2560x1440 \
  26.     -framerate 30 \
  27.     -pix_fmt 0rgb \
  28.     -f avfoundation \
  29.     -i 0 \
  30.     -c:v libx264rgb \
  31.     -crf 0 \
  32.     -preset ultrafast \
  33.     -color_range 2 \
  34.     $outfile.mkv
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement