Currently I'm generating a HLS stream like this
ffmpeg -thread_queue_size 3048 -f pulse -ac 2 -i default -c:a aac -f x11grab -s 1000x564 -r 30 -i $DISPLAY+10,151 -vcodec libx264 -preset ultrafast -maxrate 2M -bufsize 300k
-g 30 -movflags +faststart -tune zerolatency -x264opts keyint=30:min-keyint=10:no-scenecut -b:v 1000k -s 1000x562 -pix_fmt yuv420p -b:a 96k -ar 44100 -threads 0
-hls_list_size 0 -start_number 0 -hls_allow_cache 0 -hls_init_time 2 -hls_time 10 -hls_wrap 7 /usr/local/nginx/html/testlist.m3u8 2> /home/ubuntu/HLS_STREAM_LOG$$.log
and just serving it with the web server. Not sure but sometimes it's lagging tried to reduce the quality as much as possible maybe should try to output the m3u8 to an s3 bucket next and have cloudfront distribute it instead ?