executable_ffmpeg-youtube 1.8 KB

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. # shellcheck disable=SC1091
  3. . "/home/oleg/.youtube-stream-key.sh"
  4. ffmpeg \
  5. -f x11grab -video_size 1920x1080 -r 30 -thread_queue_size 512 -i "$DISPLAY" \
  6. -f pulse -ac 2 -thread_queue_size 512 -i 'alsa_input.pci-0000_00_1b.0.analog-stereo' \
  7. -f pulse -ac 2 -thread_queue_size 512 -i 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' \
  8. -filter_complex amix \
  9. -y \
  10. -c:v libx264 \
  11. -qp 0 \
  12. -pix_fmt yuv420p \
  13. -b:v 9000k \
  14. -g 60 \
  15. -c:a libmp3lame -ar 44100 \
  16. -q:a 3 \
  17. -r 30 \
  18. -threads 4 \
  19. -preset ultrafast \
  20. -f flv "rtmp://a.rtmp.youtube.com/live2/$KEY"