Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

c# - Equivalent application in xaml to WindowsForm for cam onvif

I Download this application i use example (from the official) site:https://github.com/AlexBrochu/CameraManager

This would be the image of the application: enter image description here

I need to use the same functions in my WindowsForm application, I have been researching and although there are several examples to connect, I also need to change profiles, since it usually has 3:

UriBuilder uri = new UriBuilder(media.GetStreamUri("RtspOverHttp", profiles[cbPerfilesCam.SelectedIndex].token));

I can now make a connection to the camera, because in the previous code I have the information from camera, I only need the way to transmit the image`

The code of the application that is in xaml is:

 private void StreamVideoOnVLC(String[] recordParams)
    {
        UriBuilder uri = new UriBuilder(media.GetStreamUri("RtspOverHttp", profiles[listBox.SelectedIndex].token));
        uri.Host = deviceUri.Host;
        uri.Port = deviceUri.Port;
        uri.Scheme = "rtsp";

        textBox.Text = uri.Path;

        List<string> options = new List<string>();
        options.Add(":rtsp-http");
        options.Add(":rtsp-http-port=" + uri.Port);
        options.Add(":rtsp-user=" + user.Text);
        options.Add(":rtsp-pwd=" + password.Password);

        if (recordParams.Length != 0)
        {
            foreach (string param in recordParams)
            {
                options.Add(param);
            }
        }
        
        video.MediaPlayer.Play(uri.Uri, options.ToArray());
    }

I could not find the equivalent of video.mediaPlayer.play in windowsFor. I already tried with Aforge, but I don't know how to implement the profiles, I also tried with VLC ActiveX Plugin and IE Web Plugin v2, I didn't find a way to use it, for business reasons I cannot use Ozeky

MY code so far:

private void StreamVideoOnVLC(String[] recordParams)
    {
        UriBuilder uri = new UriBuilder(media.GetStreamUri("RtspOverHttp", profiles[cbPerfilesCam.SelectedIndex].token));
        uri.Host = deviceUri.Host;
        uri.Port = deviceUri.Port;
        uri.Scheme = "rtsp";

        List<string> options = new List<string>();
        options.Add(":rtsp-http");
        options.Add(":rtsp-http-port=" + uri.Port);
        options.Add(":rtsp-user=" + userCam);
        options.Add(":rtsp-pwd=" + passCam);

        if (recordParams.Length != 0)
        {
            foreach (string param in recordParams)
            {
                options.Add(param);
            }
        }

        ??  (uri.Uri, options.ToArray());
       


    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...