executable_ffmpeg-hwaccel 653 B

123456789101112131415161718192021
  1. NAME=screencast-$(date +%Y%m%d%H%M)
  2. size=$(xwininfo -root | grep 'geometry' | awk '{print $2;}')
  3. ffmpeg \
  4. -vaapi_device /dev/dri/card0 \
  5. -hwaccel vaapi \
  6. -hwaccel_output_format vaapi \
  7. -r 60 \
  8. -s 1920x1080 \
  9. -f x11grab -s 1920x1080 -thread_queue_size 512 -i $DISPLAY \
  10. -f pulse -ac 2 -thread_queue_size 512 -i 'alsa_input.pci-0000_00_1b.0.analog-stereo' \
  11. -f pulse -ac 2 -thread_queue_size 512 -i 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' \
  12. -filter_complex amix \
  13. -vf 'format=nv12|vaapi,hwupload' \
  14. -y \
  15. -c:v h264_vaapi \
  16. -c:a libmp3lame -ar 44100 \
  17. -r 60 \
  18. -q:a 3 \
  19. $NAME.mp4