Here's a "fun" technical problem I'd like to solve.
I have a server that runs headless. I'd like to be able to queue up a video playlist on that server and have it stream to a peertube livestream.
The only live streaming video tool I am familiar with is OBS, but I don't think OBS can do what I want this to do.
Is there a commandline application in to which I can feed a list of video files, and out of which it will produce a live stream?
Here are some instructions on managing a livestream from the command line: https://github.com/fyroc/RTMP-Playlist
Really, building the playlist would benefit from another support application, but I'll deal with that when I get there.
For now, I'll make a manual playlist and do a proof of concept.
Once I've done that, the next boulder to get over is managing the playlist.
I'd like to be able to manage it somewhat intelligently, having a program make decisions about what to play and when to play it based on metadata, tags, length, and ideally a clock.
(That is to say, starting a film one minute after the hour, running it until it's over, and then filling the intervening time with shorter works until we are at the top of the hour or the half hour for the next film to start. )
Doing a TV station is easier than doing a radio station in that video and films have always been subject to the same copyright laws as everything else, and not the weird bullshit patchwork that audio recordings have had to contend with.
As a result, there are a bunch of easily identifiable, unambiguously public domain films and TV shows (many of which have never been given a home video release! Some of which I have physical copies of, and am actively digitizing.)
A lot of these films aren't very good, but some of them are excellent.
A lot of the TV shows are patchwork, with only a few episodes in the public domain.
That's fine. We'll work around it.
Other folks do it already (See The Film Detective on Sling TV for example.) and I can do a better job than that.
I'd definitely reach for ffmpeg and/or gstreamer before looking at anything else
Looks like Peertube is RTMP, and https://trac.ffmpeg.org/wiki/StreamingGuide has several RTMP guides. Hardest part if you care about it is likely to be remote control rather than setting up a queue of everything you want in advance.
That sounds like something that ffmpeg could be convinced to do, with the Right Options and possibly a simple wrapper script.
I'm not sure what the protocol is for livestreaming over peertube though, so that might be something that needs something more complex.
@ajroach42 I will also loop back to point out that OBS is scriptable in python and lua: https://github.com/obsproject/obs-studio/wiki/Getting-Started-With-OBS-Scripting
@djsundog That's not super surprising, and my best bet could very well be just using the common tooling.
@ajroach42 if i were in the same position, i would check if videolan could do it. I think it was first created to do this kikd of stuff (video or audio on LAN)
But i never do this before
@ajroach42 Yes. It may be tricky to get codecs/formats other than webm or ogg/theora to work but in theory matroska is supported too. I have no idea how well that interfaces with peertube.
I also know that the most common command line application for advanced transcoding tasks is ffmpeg.
A quick search turned up this primer on ffmpeg live stream encoding/transcoding: https://www.dacast.com/blog/how-to-broadcast-live-stream-using-ffmpeg/
A social network for the 19A0s.