0

If the RTSP stream password is "pass@word" I can only play it adding the password to the url like this:

rtsp://username:pass%40word@domain:port

Changing @ to %40 works on the URL

But when I try to use: media.AddOption(":rtsp-pwd=pass@word");

Authentication fails.

Using media.AddOption(":rtsp-pwd=pass%40word"); also fails.

Rafael F.
  • 190
  • 12

1 Answers1

1

Try the dialog callbacks

var libVLC = new LibVLC();

libVLC.SetDialogHandlers((title, text) => Task.CompletedTask,
    (dialog, title, text, username, store, token) =>
    {
        dialog.PostLogin(Username, Password, false);
        tcs.SetResult(true);
        return Task.CompletedTask;
    },
    (dialog, title, text, type, cancelText, actionText, secondActionText, token) => Task.CompletedTask,
    (dialog, title, text, indeterminate, position, cancelText, token) => Task.CompletedTask,
    (dialog, position, text) => Task.CompletedTask);

var mp = new MediaPlayer(libVLC)
{
    Media = new Media(libVLC, UrlRequireAuth, Media.FromType.FromLocation)
};

mp.Play();
mfkl
  • 1,914
  • 1
  • 11
  • 21
  • See also: https://github.com/juliusfriedman/net7mma_core/tree/master/Common/Classes Which can help if VLC fails to handle something or the camera has non standard output which requires small tweaks to the protocol – Jay Jan 12 '21 at 03:49