Skip to content

Instantly share code, notes, and snippets.

@CAFxX
Created March 1, 2021 02:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CAFxX/dafa30845b1b3872d29980b39cf15f58 to your computer and use it in GitHub Desktop.
Save CAFxX/dafa30845b1b3872d29980b39cf15f58 to your computer and use it in GitHub Desktop.
ffmpeg screencast for macos
# there's a bunch of things that don't work properly:
# - can't capture computer audio output - it desyncs
# - need to change the input devices (`-i "v:a"`) based on the output of `ffmpeg -f avfoundation -list_devices true -i ""`
ffmpeg \
-thread_queue_size 150 -f avfoundation -probesize 50M -framerate 30 -pix_fmt uyvy422 -i "2:3" \
-thread_queue_size 150 -f avfoundation -probesize 50M -framerate 30 -pix_fmt uyvy422 -capture_cursor 1 -capture_mouse_clicks 1 -i "4" \
-filter_complex '
[1]fps=fps=30[scr],
[scr]scale=-1:1440[scr],
[0]fps=fps=30[cam],
[cam]crop=ih/1.6180339887:ih[cam],
[cam]scale=-1:1440[cam],
[scr][cam]hstack[vout],
[0:a]afftdn[aout]
' \
-map '[vout]' -c:v hevc_videotoolbox -b:v 5000k \
-map '[aout]' -c:a libopus -b:a 256k \
-y output.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment