nginx-rtmp-module
nginx-rtmp-module copied to clipboard
Cannot Forward live broadcast service to any peertube instence
I followed a mix of this guide and this page to setup a dedicated debian 11 nginx VPS to multi-stream to peertube and twitch (and youtube and owncast). Peertube is currently the only streaming service that will not work, nginx-rtmp re-broadcasts to all of the others listed there just fine.
On peertube the stream indicates as "started", and I can hit the play button and the loading circle will start, but the video never actually starts playing. Will just load forever.
I have tried our own self hosted instance at https://watch.rt4mn.org and also https://diode.zone and also https://peertube.su so it does not seem to be an issue with just our peertube instance (all three servers are running peertube V 4.0.0)
I have tested playback with updated versions of firefox and chrome.
If I stream directly to the peertube instance with obs, the stream will play live just fine.
If I stream directly from the vps with ffmpeg, the stream will play live just fine. command I use for that is ffmpeg -re -i streamtest.mp4 -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv rtmp://watch.rt4mn.org:1935/live/streamkey. It is only when I try to use the nginx-rtmp module that it does not work.
Normally I use a "permanent live", but iIf when setting up the live stream in peertube I set the settings to "Stream only once and save a replay of your live", the stream will still not work, but once I finish streaming it does manage to save recording of the stream, and it does replay the video just fine.
I have tested several different versions of the nginx-rtmp-module, but none have worked. although the only two I can say for sure do not work are v 1.21.4 and the most recent version.
Current nginx config on the vps is:
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
push rtmp://stream.cyberia.club/live/streamkey
push rtmp://live.twitch.tv/app/live_streamkey;
push rtmp://a.rtmp.youtube.com/live2/streamkey;
push rtmp://watch.rt4mn.org:1935/live/streamkey;
}
}
}
I've tinkered with a bunch of different chunk sizes / configs here but none seem to work. Even just having peertube all by itself without the other streaming services does not seem to work.
I am still not sure if the issue is something with peertube or something with nginx-rtmp, so I am opening the issue on both repos.
https://github.com/Chocobozzz/PeerTube/issues/4778
Closing the issue here, since the problem seems to be on peertubes side.
Apperently nginx-rtmp does not correctly send the RTMP metadata command?
https://github.com/Chocobozzz/PeerTube/issues/4778#issuecomment-1033599945