# Applying 'FaceOverlayFilter' or 'ChromaFilter' gives ERROR

**URL:** <https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [January 4, 2024, 9:41am UTC](https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899 "2024-01-04T09:41:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atitkharel](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/atitkharel/32/2360_2.png) [@atitkharel](https://openvidu.discourse.group/u/atitkharel)\
**Post date:** [January 4, 2024, 9:41am UTC](https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899/1 "2024-01-04T09:41:27Z")

</div>

I’m trying to apply filter to a OpenVidu camera stream in a website. The server is hosted separately communicating through APIs to create sessions and tokens.

I’ve tried applying other filter type ‘GStreamerFilter’ which is working fine but applying ‘FaceOverlayFilter’ gives this error:

```auto
"org.kurento.client.internal.server.KurentoServerException: 'offsetXPercent' parameter should be a double (Code:40001, Type:null, Data: {"type":"MARSHALL_ERROR"})
	at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.sendRequest(RomClientJsonRpcClient.java:264)
	at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.invoke(RomClientJsonRpcClient.java:117)
	at org.kurento.client.internal.transport.jsonrpc.RomClientJsonRpcClient.invoke(RomClientJsonRpcClient.java:99)
	at org.kurento.client.internal.client.RomManager.invoke(RomManager.java:162)
	at org.kurento.client.internal.client.RemoteObject.invoke(RemoteObject.java:186)
	at org.kurento.client.internal.client.RemoteObjectInvocationHandler.genericMediaElementInvoke(RemoteObjectInvocationHandler.java:157)
	at org.kurento.client.internal.client.RemoteObjectInvocationHandler.internalInvoke(RemoteObjectInvocationHandler.java:95)
	at org.kurento.client.internal.client.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:39)
	at com.sun.proxy.$Proxy91.invoke(Unknown Source)
	at io.openvidu.server.kurento.endpoint.PublisherEndpoint.execMethod(PublisherEndpoint.java:356)
	at io.openvidu.server.kurento.core.KurentoSessionManager.execFilterMethodInPublisher(KurentoSessionManager.java:1378)
	at io.openvidu.server.kurento.core.KurentoSessionManager.execFilterMethod(KurentoSessionManager.java:1045)
	at io.openvidu.server.rpc.RpcHandler.execFilterMethod(RpcHandler.java:612)
	at io.openvidu.server.rpc.RpcHandler.handleRequest(RpcHandler.java:167)
	at org.kurento.jsonrpc.internal.JsonRpcHandlerManager.handleRequest(JsonRpcHandlerManager.java:142)
	at org.kurento.jsonrpc.internal.server.ProtocolManager$3.run(ProtocolManager.java:218)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
"

```

The code I’m using to apply the filters is from OpenVidu Docs as follows:

```auto
publisher.stream.applyFilter("FaceOverlayFilter")
    .then(filter => {
        filter.execMethod(
            "setOverlayedImage",
            {
                "uri":"https://cdn.pixabay.com/photo/2013/07/12/14/14/derby-148046_960_720.png",
                "offsetXPercent":"-0.2F",
                "offsetYPercent":"-0.8F",
                "widthPercent":"1.3F",
                "heightPercent":"1.0F"
            });
    });

```

Similar thing happens when applying ‘ChromaFilter’ type. The error shows as:

```auto
ERROR:org.kurento.client.internal.server.KurentoServerException:'topRightCornerX' property should be a integer

```

While using this code from documentation:

```auto
publisher.stream.applyFilter(
    "ChromaFilter",
    {
        "window": {
            "topRightCornerX": 0,
            "topRightCornerY": 0,
            "width": 50,
            "height": 50
        },
        "backgroundImage": "https://www.maxpixel.net/static/photo/1x/Cool-Blue-Liquid-Lake-Abstract-Background-Clear-316144.jpg"
    });

```

Any idea why this could be happening when the value is already an integer? I searched everywhere but could not find similar problem faced by other users.

---

<div class="post-metadata">

**Author:** ![DiStefano8472](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/distefano8472/32/1538_2.png) [@DiStefano8472](https://openvidu.discourse.group/u/DiStefano8472)\
**Post date:** [January 10, 2024, 6:29pm UTC](https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899/2 "2024-01-10T18:29:01Z")

</div>

@atitkharel

Hi,  
at the moment I make some tests with these filters too. But I also get these type error messages - and I tried a lot of formattings.  
Did you solve your problem?

Best regards  
Stefan

---

<div class="post-metadata">

**Author:** ![DiStefano8472](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/distefano8472/32/1538_2.png) [@DiStefano8472](https://openvidu.discourse.group/u/DiStefano8472)\
**Post date:** [January 10, 2024, 8:03pm UTC](https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899/3 "2024-01-10T20:03:57Z")

</div>

@micael.gallego

What about the documented limitation in release notes of Openvidu 2.9.0?  
Is this problem still existing?

> We still consider Ubuntu Bionic to be in a preliminary support state, and some bugs may appear. In fact, we know for sure there’s one limitation: no OpenCV filters will work in Ubuntu 18.04 at this moment. OpenVidu has supported [audio and video filters](https://docs.openvidu.io/en/2.28.0/advanced-features/filters/) for a long time now, and it is a cool feature that allows developers to implement some advanced audio and video real-time processing in the server side. But unfortunately Kurento has not been updated yet to support it in Bionic, so no FaceOverlayFilter or ChromaFilter will work in new Ubuntu version. But you can still use [GStreamer filters](https://docs.openvidu.io/en/2.28.0/advanced-features/filters/#gstreamer-filters)!

---

<div class="post-metadata">

**Author:** ![atitkharel](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/atitkharel/32/2360_2.png) [@atitkharel](https://openvidu.discourse.group/u/atitkharel)\
**Post date:** [January 15, 2024, 12:23pm UTC](https://openvidu.discourse.group/t/applying-faceoverlayfilter-or-chromafilter-gives-error/4899/4 "2024-01-15T12:23:28Z")

</div>

No luck solving it. Maybe it is because of the limitation mentioned by you in another reply because i think our implementation of OpenVidu server is in a Ubuntu instance. Will need to check.
