https://www.wowza.com/docs/how-to-add-graphic-overlays-to-live-streams-with-wowza-transcoder
Developed wowza module to add overlay in live streaming using above link. Overlay images added into live stream but id didn’t scaled properly.
if (!encoderInfo.destinationVideo.isPassThrough())
{
int destinationHeight = encoderInfo.destinationVideo.getFrameSizeHeight();
scalingFactor = (double)destinationHeight/(double)sourceHeight;
System.out.println(“desination height”+destinationHeight);
System.out.println(“source height”+sourceHeight);
System.out.println(“scaling factor”+scalingFactor);
TranscoderVideoOverlayFrame overlay = new TranscoderVideoOverlayFrame(mainImage.GetWidth(scalingFactor),
mainImage.GetHeight(scalingFactor), mainImage.GetBuffer(scalingFactor));
overlay.setDstX(mainImage.GetxPos(scalingFactor));
overlay.setDstY(mainImage.GetyPos(scalingFactor));
encoderInfo.destinationVideo.addOverlay(overlayIndex, overlay);
//Add padding to the destination video i.e. pinch
encoderInfo.videoPadding[0] = 0; // left
encoderInfo.videoPadding[1] = 0; // top
encoderInfo.videoPadding[2] = 0; // right
encoderInfo.videoPadding[3] = (int)(((double)videoBottomPadding.getStepValue())*scalingFactor); // bottom
encoderInfo.destinationVideo.setPadding(encoderInfo.videoPadding);
}
For scaling above code is used. I tried to print out destination and source height and scaling factor. Scalling factor changes with respect to stream.
But overlay image size remaing same for all streams. But if i add overlay via wowza manager and then view in different stream. Overlay image scaled correctly.