Awesome, thanks for this. Works pretty good for live programming, already usable. With 1080i source and any bitrate 1080p output, it starts at a healthy 1.5x transcode (and slowly drops, I guess as it hits a full buffer and converges on real-time 1x??). Not sure if it respects the bitrate setting, but all 1080p's work well with either 1080i or 720p source. CPU is 130% or below. Really impressive.
I did encounter one hitch: after a minute or two in the web viewer the stream just stopped flat, and these warnings were in the log:
2019/08/16 21:29:39 [WRN] Buffer for 10654FDA ch11.1 is more than 50% full (clients=1, len=16777684)
2019/08/16 21:29:44 [WRN] Buffer for 10654FDA ch11.1 is more than 50% full (clients=1, len=16777684)
2019/08/16 21:29:49 [WRN] Buffer for 10654FDA ch11.1 is more than 75% full (clients=1, len=25166132)
2019/08/16 21:29:51 [WRN] Buffer for 10654FDA ch11.1 is more than 50% full (clients=1, len=16777420)
2019/08/16 21:29:56 [WRN] Buffer for 10654FDA ch11.1 is more than 75% full (clients=1, len=25167052)
As you found, rescaling hits hard. So the 720p output setting with 1080i source could only achieve 0.85x or so. Even 720p source to 576p output grinds to a halt. But during either of these, it's still only using 130% CPU. I gather de-interlacing and scaling are single threaded? Possible to double up threads?
And unfortunately, hardware transcoding doesn't work at all for streaming pre-recorded segments. Just spins and refuses to start the stream at all (despite advertising early speeds up to 1000x). You'd think pulling from disk would be easier than juggling an incoming network stream, so maybe just some setting there.
Great start!