Received multiple MediaStream object for single mid

@lorenzo ,
I have created the “multistream” mountpoint in “janus.plugin.streaming.jcfg”.
Below are the image of created mountpoint for your reference:

I iransmit the RTP packet from RTSP stream to Janus using FFMPEG.
Below is the example of ffmpeg command:

ffmpeg -rtsp_transport tcp -i rtsp://rtsp:rtsp@192.246.23.50:5540/b8c37f136 -c:v copy -an -f rtp rtp://10.12.55.149:5001

I have initially received MediaStream for mid=1, but after some second i have received different MediaSTream for same mid=1.

So, my question is why i received multiple MediaStream for single mid ?

Because before the new MediaStream received, i observed the stream goes to loading and after connect again.

Below are the onremotetrack event, where i received track and i fetch the MediaStream from track and attached it to the video element:

Have you checked if it’s not simply the browser telling you a track went away? The on flag will tell you if a track was added or removed. Not sure what happens if it’s removed and added again (e.g., because the browser triggered an onmute and then onunmute) and if that can cause the stream you get to be different.