record a web stream to youtube

For example you have a web stream from a site with m38u files and wanted to stream it to youtube

ffmpeg -re -i <m3u8_5000kbps_url> -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 3000k -f flv "<youtube_rtmp_address>/<stream-code>"

Example:

ffmpeg -re -i protocol://domain.tld/stream.m3u8 -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 3000k -f mp4 "rtmp://a.rtmp.youtube.com/live2/abcdefgh-ijklmnd"

taken from: https://gist.github.com/qntmpkts/403a027a4bfe99812ebf8952c41f8789