> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/unix/record-a-web-stream-to-youtube.md).

# 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>
