xaml 中的等效应用程序到 WindowsForm for cam onvif

问题描述

我下载这个应用程序,我使用示例(来自官方)网站:https://github.com/AlexBrochu/CameraManager

这将是应用程序的图像:enter image description here

我需要在我的 WindowsForm 应用程序中使用相同的功能,我一直在研究,虽然有几个例子可以连接,但我也需要更改配置文件,因为它通常有 3 个:

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

我现在可以连接到相机了,因为在前面的代码我有相机的信息,我只需要传输图像的方式`

应用程序在xaml中的代码是:

 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());
    }

我在 windowsFor 中找不到 video.mediaPlayer.play 的等效项。我已经尝试过 Aforge,但我不知道如何实现配置文件,我也尝试过 VLC ActiveX 插件和 IE Web 插件 v2,我没有找到使用它的方法,出于商业原因我不能使用 Ozeky

到目前为止我的代码

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());
       


    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...