Mixedreality-webrtc: Is it possible to create two track, one with MRC, the other without it ?

Created on 6 Oct 2020  路  4Comments  路  Source: microsoft/MixedReality-WebRTC

Is it possible to create two track from the same camera?
I found the code snippet where the source created.
Can I create a source with MRC, and another source without MRC?

try
{
    var source = await DeviceVideoTrackSource.CreateAsync(deviceConfig);
    AttachSource(source);

    // is it possible to do something like this?
    var sourceWithoutMRC = await DeviceVideoTrackSource.CreateAsync(deviceConfigWithoutMRC);                
    AttachSource(sourceWithoutMRC);
}
catch (Exception ex)
{
    Debug.LogError($"Failed to create device track source for {nameof(WebcamSource)} component '{name}'.");
    Debug.LogException(ex, this);
    return;
}
question

All 4 comments

I'm not sure. My guess is that it won't work because the webcam cannot be shared by the 2 tracks. It is not a limitation about MRC, but about creating two tracks from the same video capture device. Also that might be quite heavy to process for HoloLens, as this might go over budget for the internal hardware encoder, so might need to fallback to software, which will drain the battery. In short, even if that works, I would discourage it. I would instead switch (destroy/recreate) between a track with and a track without, as needed. Creating a track shouldn't take more than a second or two.

Thank you for the advice!
I will try this idea!

And another question
When I look into the source code
in the "device_video_track_source.cpp" script
I found this line of code to create the video source (I think) (at line 197)

auto vcd = wrapper::impl::org::webRtc::VideoCapturer::create(createParams);

But I can't find where this function was defined, could you give me some hint.
Thank you so much !!!

Thank you so much!
This is exactly what i am looking for!
I will go on and dig into it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

psantosl picture psantosl  路  4Comments

StephenHodgson picture StephenHodgson  路  3Comments

CabbageWarrior picture CabbageWarrior  路  3Comments

amfdeluca picture amfdeluca  路  7Comments

CabbageWarrior picture CabbageWarrior  路  5Comments