Wowza Community

Limit the number of transcoded streams that have a bitrate / resolution higher than the source

Faced this problem. It makes no sense to create additional streams if they are not needed. Found a similar question https://www.wowza.com/community/questions/6292/limit-number-of-transcoded-streams-based-on-source.html. Any solutions? Thanks.

I think I wrote a module once that checked the bitrate of the incoming stream and then adjusted the transcoder template so that it would not use any outputs that had a higher bitrate. I did the same in another module but for the display size. If you’re familiar with Wowza’s Java API, you could e.g. use the ILiveStreamTranscoderActionNotify.onInitBeforeLoadTemplate - provided that the bitrate is known e.g. in the metadata that you can get from IMediaStreamActionNotify3.onMetaData.

If you don’t know the required metric(s) from the metadata, you will have to wait for some seconds until Wowza has read the stream long enough to hand you an average bitrate. Or, for the resolution - if it’s not in the metadata, you could use ILiveStreamTranscoderActionNotify.onSessionVideoDecodeCodecInfo (but you can’t change the transcoder template at that point, you will simply have to remove the output via liveStreamTranscoder.getTranscodingStream().removeDestination(destination.getName());