Check out PeerTube. It may be exactly what you're looking for.
Looking at that, possibly MediaGoblin could work.
Alternately, something like Jellyfin may work, but that's a little bit of a push.
[0] https://alternativeto.net/software/youtube/?platform=self-ho...