NGINX RTMP Streaming Server for Church reddit / selfhosted ---------------------------------------------------------------------- LazyTech8315 · 2023-11-12 14:59 I asked for some help in r/nginx, but I haven't received any responses in 3 months, so I don't think asking a new related question will help... (Related, but not: [https://www.reddit.com/r/nginx/comments/15 ri9cy/rtmp\_server\_push\_to\_application\_vlc\_fails\_to\_load/?rdt=4 0507](https://www.reddit.com/r/nginx/comments/15ri9cy/rtmp_server_push _to_application_vlc_fails_to_load/?rdt=40507)) I've tried using something like this to switch inputs for my stream, but it failed ([https://github.com/nxtreaming/nginx-rtmp-switch/blob/m aster/nginx\_example.conf](https://github.com/nxtreaming/nginx-rtmp- switch/blob/master/nginx_example.conf)) Could this be related to above, since I only tested with VLC? Now that I went a little off in different directions, let me explain what I really envision. I built and self-host a streaming service for our church out of need during the pandemic. The board did not want to use YouTube or any other public service. Building it was a learning curve, and we continue to use it since it's proven to be very useful for remote members and costs us nothing to run now that it exists. However, I'd like to expand it. This is what we currently have: * OBS * nginx RTMP Server * Owncast * nginx Web server * Custom PHP We have viewers using VLC and Owncast, but some older links use a custom made site that uses HLS. This can be changed, NP. Nginx records the broadcast to .flv and I have scripts that auto-edit silence out of the file, and convert to MP4 for later viewing from archive, with a little front-end calendar, etc. What we want to add on is this: * Schedule re-broadcasting of services for people in different time zones or those who missed the first one. * Some viewers cannot figure out how to browse recordings and play it on their own. They're 90+ y/o, so we need to accommodate, not educate. * The re-broadcast should not be recorded again, so using a switch input like the link above would likely be needed. * It would be nice to have SOMETHING on the stream viewable 24/7, like: * Play music, shuffled in random * Show the schedule of when we'll be live (with a countdown) * Re-broadcasted services * Having something always broadcasted would help eliminate the "I can't connect" phone calls as well as the "Are you broadcasting tonight?" questions. * VLC RTMP viewing offers the lowest latency, so we'd like to continue offering this, especially for local people. * I'd like to consider using r/kodi as a front end for viewing live and VOD of pre-recorded content. I have this for myself, but it seems clumsier than it should be for the average age of our viewer. Essentially, I want it to act a bit like a mini TV station, following a schedule for programs, advertise the next broadcast, etc. It will be 100% our own content as it is now. I will script the scheduling, picking of pre-recorded content to play, etc (unless someone knows of open source software that does this)... I believe I only need help with the nginx configuration but I'm open to comments on the overall design. Any thoughts on this? Thank you! ---------------------------------------------------------------------- NHarvey3DK · 2023-11-12 18:15 Every small, big, and megachurch streams via YouTube. Do the same. Tell them it’s impossible otherwise and move on. ---------------------------------------------------------------------- LazyTech8315 · 2023-11-12 18:36 Wait, did I post this in r/shootdownmyidea? LOL That's not self-hosting. I'm not going into the fundamental legal and logistical limitations of our broadcast, but there's a reason that I posted this in r/selfhosted. We usually have 3-5 remote viewers on Sunday morning and about double that during the week, so I don't care about using a CDN. Technically, it's my idea, but really there is no them and me. I'm part of the church and have been for 48 years. As an IT/MSP owner and a software developer, I have every intention of continuing to host this as it has been for over 3 years. This is just the next enhancement. ---------------------------------------------------------------------- ProfessionalAd3026 · 2023-11-12 20:54 I had a similar setup initially due to the same reasons. I only used HLS-based playback. I would chop the files locally and upload them to our web server. I learned the hard way that Android mobile devices are a nightmare to support. Some had simply no sound. Significantly, older people would not care if a device is still supported. Some simply wouldn’t load the sound. Eventually, we moved to YouTube. The solution we kept, though, is something you might want to consider. We have our lifestream on an internal web page. If it’s close to the actual service, we have a countdown and lifestream. Once the lifestream is done, the same page switches to VOD. If you didn't make it to the real lifestream, why do you need to be on time for the re- stream? ---------------------------------------------------------------------- LazyTech8315 · 2023-11-12 22:27 >The solution we kept, though, is something you might want to consider. We have our lifestream on an internal web page. If it’s close to the actual service, we have a countdown and lifestream. I'd be interested to hear some more details on that to see if that's something I can borrow. It's all running on a Debian VM and K8 app (owncast) on TrueNAS. >If you didn't make it to the real lifestream, why do you need to be on time for the re-stream? Fundamentally, I agree with you, but we have members who can't double click without copying icons all over the screen or renaming them. I have one particular laptop set up to auto log in and auto load VLC full screen, loading the rtmp stream. If he could know that the stream will auto play back at a particular time, he could watch the re- stream. Otherwise, I have to remote control the laptop and do it for him. I'm trying to make it easier. Another thought I've entertained is a hardware RTMP receiver that plugs in to a TV with HDMI. It would save the laptop from being crash rebooted daily. LOL ---------------------------------------------------------------------- ProfessionalAd3026 · 2023-11-14 12:46 The simplest way to put it is to consider an index page an intermediate layer. If a lifestream is running, start at the current moment; otherwise, deliver the last lifestream from the start. For your VLC use case, you might be able to have VLC open an m3u playlist that you dynamically change. I doubt the TV stick would help. At this level, switching HDMI inputs is out of scope. Maybe a read-only, or memory-based Linux system might be the way to go. Unless you kill it during boot, there is no way to corrupt the disk. ---------------------------------------------------------------------- LazyTech8315 · 2023-11-14 15:13 I don't know how to make the M3U seamless so it will stream continuously as the program changes. Maybe I'll figure that out one day. >Maybe a read-only, or memory-based Linux system might be the way to go. That's a great thought. I've built rofs systems before when the layers were all manually configured. Should be easily doable, but I expected that the computer would be used for something else too. Also, I have screenconnect installed so I can remotely help. ---------------------------------------------------------------------- kmisterk · 2023-11-17 18:20 I would like to help, but I'm largely unfamiliar with the media components of nginx, but I commend your efforts. It's *very* cool to come to an understanding with what you've *already* created on this. Super cool. Good luck on your expansion needs! ---------------------------------------------------------------------- gabekangas · 2023-12-06 15:59 You could probably make this as complex as you'd like. The simple solution would be to just queue up a playlist that you generated, and have ffmpeg play it back, outputting the RTMP. There's also some open source playout automation software. What you're looking for is most likely something similar to \- [https://github.com/TheDerpySage/comfy- channel](https://github.com/TheDerpySage/comfy-channel) \- [https://github.com/ffplayout/ffplayout](https://github.com/ffplayo ut/ffplayout) \- [https://github.com/mint- dewit/folderplayout](https://github.com/mint-dewit/folderplayout) There's also a ton of commercial playout automation sofware out there, but I'm not familiar of any of them. ---------------------------------------------------------------------- LazyTech8315 · 2023-12-08 15:40 Thank you! I will check these out. It looks like the first two are best suited for headless operation, so I'll start there.