I'm having trouble getting an image overlay to show up over the loopback video. I'm able to do a loopback with the script with rtpEndpoint.connect(rtpEndpoint, function....)
but when I try to add in the ImageOverlayFilter I get some errors which I haven't been able to resolve.
Error: Invalid value for 'MediaType'
"error" : {"code" : 40001,"data" : {"type" : "MARSHALL_ERROR"},"message" : "Invalid value for 'MediaType'"}
var overlayparams = {
id: "TESTTEST",
uri: "file://tmp/media/sample.png",
offsetXPercent: 0,
offsetYPercent: 0,
widthPercent: 0,
heightPercent: 0,
keepAspectRatio: true,
center: true,
mediaPipeline: pipeline
}
pipeline.create("ImageOverlayFilter", overlayparams, function (error, filter) {
if (error) return console.log(">>>>>"+ error);
return callback(null, rtpEndpoint, filter);
});
later in the file
rtpEndpoint.connect(rtpEndpoint, imageOverlay, rtpEndpoint, function (error) {
if (error) return onError(error);
console.log("Added overlay to loopback");
});
/*
// This works for normal loopback
rtpEndpoint.connect(rtpEndpoint, function (error) {
if (error) return onError(error);
console.log("loopback works");
});
*/
I've also tried using the filter.addVideo method instead of the overlayparams object but it produces the same results.