Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to turn on the simulcast? #15

Open
AkaneAzumi opened this issue Aug 8, 2023 · 0 comments
Open

How to turn on the simulcast? #15

AkaneAzumi opened this issue Aug 8, 2023 · 0 comments

Comments

@AkaneAzumi
Copy link

Hi, I used your SDK in my code and everything is fine with the push stream. But when I added the simulcast related configuration to the code, there was only one stream when played. Here's my code. Is my configuration incorrect?
` val encodings= mutableListOf<RtpParameters.Encoding>()
encodings.add(RtpParameters.Encoding("h", true, 1.0))
encodings.add(RtpParameters.Encoding("m", true, 2.0))
encodings.add(RtpParameters.Encoding("l", true, 4.0))

        val init = RtpTransceiver.RtpTransceiverInit(
            RtpTransceiver.RtpTransceiverDirection.SEND_RECV, Collections.emptyList(), encodings
        )

        peerConnection!!.addTransceiver(MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO, init)`

`val decoderFactory: VideoDecoderFactory =
DefaultVideoDecoderFactory(eglBase!!.eglBaseContext)
val encoderFactory: VideoEncoderFactory = DefaultVideoEncoderFactory(
eglBase!!.eglBaseContext,
true,
true
)

    val simulcastVideo = SimulcastVideoEncoderFactory(encoderFactory,encoderFactory)

    PeerConnectionFactory.initialize(
        PeerConnectionFactory.InitializationOptions
            .builder(context)
            .createInitializationOptions()
    )
    PeerConnectionFactory.builder()
        .setOptions(PeerConnectionFactory.Options())
        .setAudioDeviceModule(JavaAudioDeviceModule.builder(context).createAudioDeviceModule())
        .setVideoEncoderFactory(simulcastVideo)
        .setVideoDecoderFactory(decoderFactory)
        .createPeerConnectionFactory()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant