Restream To Youtube
You can also re-stream a Red5 Pro stream to a different destination other than a Red5 Pro server. For example, you can use FFmpeg to re-stream a Red5 Pro stream to YouTube.
Note: You need to have a valid YouTube account and should navigate to the Creator Studio Live Streaming. Follow the youtube ‘Encoder setup’ guide properly and make a note of the ‘Server URL’ & ‘Stream name/key’ parameters.
We recommend using RTSP over RTMP to read a Stream from Red5 Pro for restreaming
Sample command to re-stream a live RTMP stream to YouTube from Red5 Pro without re-encoding
ffmpeg -i rtmp://127.0.0.1:1935/live/streamname live=1 timeout=2 -vcodec copy -acodec copy -f flv {Server URL}/{Stream name/key}
Sample command to re-stream a live RMTP stream to YouTube from Red5 Pro with re-encoding
Linux
ffmpeg -i rtmp://127.0.0.1:1935/live/streamname live=1 timeout=2 -vcodec libx264 -s 640x480 -vb 500k -acodec libfdk_aac -ab 128k -f flv rtmp://a.rtmp.youtube.com/live2/{Stream name/key}
Windows
ffmpeg -i rtmp://127.0.0.1:1935/live/streamname live=1 timeout=2 -vcodec libx264 -s 640x480 -vb 500k -acodec aac -strict experimental -ab 128k -f flv rtmp://a.rtmp.youtube.com/live2/{Stream name/key}
Sample command to re-stream a live RTSP stream to YouTube from Red5 Pro with re-encoding
Linux
ffmpeg -rtsp_transport tcp -i rtsp://127.0.0.1:8554/live/streamname -acodec copy -vcodec copy -f flv rtmp://a.rtmp.youtube.com/live2/{Stream name/key}