RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

Error "SRT_REJ_UNSECURE" when using SRT protocol for livestream

Open cryinrain69 opened this issue 11 months ago • 11 comments

Describe the bug

I am using SrtCamera2 + OpenGlView. If on srt server no passphrase set, it works fine. But when on srt server, using passphrase, app cannot livestream with reason "Error configure stream, SRT_REJ_UNSECURE" in onConnectionFailed callback. In code I have set passphrase as follows:

srtCamera2.streamClient.setPassphrase("1234567890", EncryptionType.AES192)

I have tried changing EncryptionType to NONE, AES128, AES192, AES256 but still get the same error (on server is using keylength = 24).

If I use the CameraFi Live app (on Play Store) and set the SRT parameters as shown in the image below, the livestream is still normal. Please check help me.

image

Smartphone (please complete the following information): Library version [2.5.5] Device: [Samsung Galaxy S22 Ultra] OS: [Android 14] Class used: [RtmpCamera2 + OpenGlView]

cryinrain69 avatar Jan 07 '25 09:01 cryinrain69

Hello,

Can you tell me your server name and version to reproduce your case? I only tested this feature with MediaMTX server.

pedroSG94 avatar Jan 08 '25 10:01 pedroSG94

Hello,

Can you tell me your server name and version to reproduce your case? I only tested this feature with MediaMTX server.

Hi. Sorry for the late reply. I am running with vMix software.

cryinrain69 avatar Jan 10 '25 02:01 cryinrain69

Hello,

vMix is used to send video/audio to the server, I can't see a media server of vMix? Can you share a link to install and download?

pedroSG94 avatar Jan 10 '25 08:01 pedroSG94

Hello,

vMix is used to send video/audio to the server, I can't see a media server of vMix? Can you share a link to install and download?

Hi. You can refer here: vmix.com https://www.vmix.com/help23/index.htm?SRT.html https://www.vmix.com/help23/index.htm?SRTInput.html

cryinrain69 avatar Jan 10 '25 08:01 cryinrain69

But this is the pusher side. I want the server side to configure it and reproduce the error using RootEncoder with the same enviroment

pedroSG94 avatar Jan 10 '25 08:01 pedroSG94

image

cryinrain69 avatar Jan 10 '25 08:01 cryinrain69

vMix is ​​also a media server.

cryinrain69 avatar Jan 10 '25 08:01 cryinrain69

Ok, I see. I will check it. Are you able to work using ffmpeg or other pusher? do you have command example?

pedroSG94 avatar Jan 10 '25 08:01 pedroSG94

Ok, I see. I will check it. Are you able to work using ffmpeg or other pusher? do you have command example?

No. This is already supported by the vMix software, I just need to set up the parameters and use it. Thank you very much.

cryinrain69 avatar Jan 10 '25 09:01 cryinrain69

Hello. Same problem, I also get the same error when using passphrase: Error configure stream, SRT_REJ_UNSECURE

genericStream.getStreamClient().setPassphrase("1234567890", encryptionType) encryptionType: EncryptionType.AES128 / EncryptionType.AES192 / EncryptionType.AES256

@pedroSG94 Can you check and fix it soon for me?

TranNam68 avatar Mar 25 '25 04:03 TranNam68

Hello,

I will check it

pedroSG94 avatar Mar 25 '25 16:03 pedroSG94

Hello,

Any updates on this? I'm getting the same error.

I'm trying to use ffplay to read the stream using the following command:

ffplay "srt://192.168.2.17:9001?mode=listener&streamid=a&passphrase=1234567890&pbkeylen=16"

And in the app I set my passphrase as follows:

genericStream.getStreamClient().setPassphrase("1234567890", EncryptionType.AES128)

Here's my ffplay output:

13:18:03.251000/*E:SRT.cn: @393743052: HS EXT: Agent declares encryption, but Peer does not - rejecting connection per enforced encryption. 13:18:03.251000/!W:SRT.cn: @393743052:newConnection: connection rejected due to: INTERNAL REJECTION - ERROR:UNSECURE 13:18:03.251000/!W:SRT.cn: processConnectRequest: rsp(REJECT): 1011 - Password required or unexpected

It works fine without a passphrase set.

Thanks!

RobbieElias avatar Jul 29 '25 17:07 RobbieElias

Hello,

This issue was freezed because I had no way to reproduce using vMix because the trial license expired I was able to reproduce it with ffplay and now, it is fixed here: https://github.com/pedroSG94/RootEncoder/pull/1883 Try again with master branch and confirm that it is working for you

pedroSG94 avatar Jul 30 '25 00:07 pedroSG94

That fixed it. Thanks for the quick update!

RobbieElias avatar Jul 30 '25 00:07 RobbieElias

Closing as fixed

pedroSG94 avatar Jul 30 '25 00:07 pedroSG94