Restream M3U8 source to Facebook Youtube Live

126 Likes 2 Comments

How to restream a m3u8 stream to YouTube/Facebook with FFmpeg
Whilst it’s not common if you want to restream a m3u8 source and view through YouTube here is the way to do it with FFmpeg.

You need to have the m3u8 link and FFmpeg, this method is usually used on a server and then you can view a location blocked m3u8 stream on YouTube (Smart tv).

The FFmpeg batch scripts is:

ffmpeg -re -i -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 2500k -f flv rtmp://

This FFmpeg command copies the m3u8 link and connects to YouTube and streams it live. We are not encoding it, just passing it through to YouTube. The audio defines are just common values and the buffersize is the amount of buffer given.

The only things you need to change unless you wanna play around with audio variables are to your actual m3u8 stream url

Put your YouTube live stream key to rtmp:// where it says YOUTUBESTREAMKEYHERE

Run the batch script and it will start streaming. Do note if you’re streaming copyrighted content to put the stream unlisted / private.

Thats how to restream or pass on a m3u8 stream to YouTube with FFmpeg.

You might like


About the Author: Toc Xoan


  1. i use your command on my ubuntu server, ffmpeg installed but the command do nothing, but if i used for youtube stream eveythink OK, just error for facebook live stream

    1. The command for streaming for Facebook is something like that:

      ffmpeg -re -i -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 2500k -f flv rtmps://

      Hope it help 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *