I am thinking of creating a kms filter which will take input as 2 mediapipeline (A) (B) and output one mediapipeline (C) with Video from 1st mediapipeline (A) and Audio from 2nd media pipeline (B).
I am confused, shall I do this on java level or shall I do this in KMS filter level, Is it even possible to achive this in Java/KMS Filter layer ?
The simplest way to do this is to create all in one pipeline because different media pipelines cannot share media easily. All can be implemented from the client side (java or js).
You can receive media from two Endpoints
(for example WebRtcEndpoints
), webRtcEp1
and webRtcEp2
and emit using webRtcEpOut
. Then just connect them like this:
webRtcEp1.connect (webRtcEpOut, MediaType.AUDIO);
webRtcEp2.connect (webRtcEpOut, MediaType.VIDEO);
At this point, WebRctOut
is emiting audio from webRtcEp1
and video from webRtcEp2
.