Please tell me how to apply the image overlay filter to the kurento group call.

52 views
Skip to first unread message

김민지

unread,
Aug 3, 2021, 1:33:00 AM8/3/21
to kurento
I'm trying this way at UserSession.java.
However, the image does not appear on the video.
I think the image path will be correct because the image has already been successful in the example of the kurento-magic-mirror.


``` java
public void receiveVideoFrom(UserSession sender, String sdpOffer) throws IOException {
    log.info("USER {}: connecting with {} in room {}", this.name, sender.getName(), this.roomName);

    log.trace("USER {}: SdpOffer for {} is {}", this.name, sender.getName(), sdpOffer);

    //image Overlay Filter
    System.out.println("[UserSession] receiveVideoFrom image 필터 씌우기");
    ImageOverlayFilter imageOverlayFilter=new ImageOverlayFilter.Builder(pipeline).build();
    String imageId = "testImage";
    String imageUri = "/home/ubuntu/image/flower.jpg";
    System.out.println("image start imageId: "+imageId+" imageUri: "+imageUri+" pipeline: "+pipeline);
    //imageOverlayFilter.removeImage(imageId);
    imageOverlayFilter.addImage(imageId, imageUri, 0.4f, 0.4f, 0.4f, 0.4f, true, true);
    this.getEndpointForUser(sender).connect(imageOverlayFilter);
    imageOverlayFilter.connect(this.getEndpointForUser(sender));


    System.out.println("[UserSession] sdpSession start");
    final String ipSdpAnswer = this.getEndpointForUser(sender).processOffer(sdpOffer);
    final JsonObject scParams = new JsonObject();
    scParams.addProperty("id", "receiveVideoAnswer");
    scParams.addProperty("name", sender.getName());
    scParams.addProperty("sdpAnswer", ipSdpAnswer);

    log.trace("USER {}: SdpAnswer for {} is {}", this.name, sender.getName(), ipSdpAnswer);
    this.sendMessage(scParams);
    log.debug("gather candidates");
    this.getEndpointForUser(sender).gatherCandidates();
  }
```

김민지

unread,
Aug 3, 2021, 8:16:45 PM8/3/21
to kurento
I solved the problem by connecting the pipeline in the following way.

UserSession.java
...
 sender.getOutgoingWebRtcPeer().connect(imageOverlayFilter);
 imageOverlayFilter.connect(incoming);
...


2021년 8월 3일 화요일 오후 2시 33분 0초 UTC+9에 김민지님이 작성:
Reply all
Reply to author
Forward
0 new messages