transcode output

Support forum for minisatip
Post Reply
UKenGB
Posts: 23
Joined: Wed Apr 21, 2021 7:54 pm

transcode output

Post by UKenGB »

I'm trying to play satellite radio streams (FreeSat here in UK) in IP radio players and it plays perfectly in some, but the players I want to use do not support mp2 audio files which is the format of the satellite streams. Trying to insert a transcoding stage (e.g. with ffmpeg) is not impossible, but adds enormously to the complexity. Without that, the player just accesses the SAT>IP URL and minisatip starts streaming. Then when nothing is 'listening', minisatip stops streaming from the tuner. A perfect streaming service. But once a transcoding step is required, starting and stopping is much more complicated as the transcoding process needs to be somehow started and stopped on demand, in sync with the actual stream from the tuner. However…

If minisatip had a transcoding option (probably performed by an external transcoder like ffmpeg), that could be started and stopped by minisatip as it started and stopped the actual stream from the tuner. So with a few additional configuration parameters for minisatip, the entire process remains as simple as it is currently, except that the stream being sent would be in a different format to that coming from the tuner.

Is this something that could be incorporated into minisatip? And/or can anyone suggest the best way to transcode minisatip output?

Thanks.
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: transcode output

Post by cata »

I was thinking about implementing this, but not many such requests were filed. My use case would be reducing the BW of the video channels.
UKenGB
Posts: 23
Joined: Wed Apr 21, 2021 7:54 pm

Re: transcode output

Post by UKenGB »

I think it's a great idea cata, but as you are probably aware, I had a big argument with lars??? on the github issues forum about this. He was adamant that transcoding has no place in minisatip, but I completely disagree. The problem of linking between the client/player and minisatip, with a separate transcoder process in between is easy if it's all running 24/7, but when you need everything to start and stop in sync with when first listener connects and last listener disconnects respectively, it is far from trivial. The lars?? guy insisted this would take only 20 mins to set up, but that's nonsense and anyway pumping the stream from one process to another can never be as efficient as the source (i.e. minisatip) handling this as and when listeners connect and disconnect, which it already monitors in any case.

Also, I cannot see it would be hugely difficult to add functionality to minisatip to pass the stream via an external transcoder (ffmpeg being the obvious choice) before outputting onto the network. Leave all the actual transcoding to ffmpeg and its appropriate configuration to the user. So minisatip would only require the transcoder's executable path and option string. Only 2 strings required to configure, either on the minisatip command line or (better I think) in a minisatip config file.

SAT>IP has to be the future for satellite (and also terrestrial digital and cable) use and to be able to output these streams in any format required by the listeners (and possible with ffmpeg of course, but that includes EVERYTHING) would IMO be a great asset for minisatip.

Anything I can do to help?
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: transcode output

Post by cata »

The only complication is basically managing multiple channels inside of the same mpegts stream.

About efficiency, I can do it either using ffmpeg api or using linux pipes to pipe into an external process. From efficiency perspective the piping may not be more efficient, but compatible with custom ffmpegs built for different HW decoders (arm, ...)
UKenGB
Posts: 23
Joined: Wed Apr 21, 2021 7:54 pm

Re: transcode output

Post by UKenGB »

Yes I understand about multiple streams. It occurs to me that it needs to be per stream, so perhaps an additional (optional) parameter in the URL that tells minisatip to transcode or not as that really has to be specified on an individual stream basis. So e.g. the URL can have an (optional) additional parameter like '&tc=somename' that would reference a named transcode settings block (i.e. executable and options) in a minisatip config file. That way it would be transparent to anyone who did not want to use it, but those who do could set up suitable transcode configurations and simply select one by including it in the URL, or not in which case no processing of the stream at all.

It HAS to be part of the URL as the same transcoding cannot be forced on every stream, nor linked to a specified tuner. It HAS to applied on a stream by stream basis, still working like minisatip does now, so the same URL request just gets another copy of the existing stream (transcoded or not) and from the same tuner, rather than tying up another tuner (and another transcode process) to produce the exact same stream format.

This would be outside the SAT>IP spec I realise, but it's an addition that need not be used if not required, so would still actually comply with the spec.

From my point of view, the other important aspect is that the transcode process is only invoked when the first listener requests a stream and is killed when the last listener disconnects.
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: transcode output

Post by cata »

I will keep your request in mind, if there are other request maybe will implement it in the future
Post Reply