Camera 使用VitaminCtrl将vivotek ip摄像头集成到C#windows应用程序中

Camera 使用VitaminCtrl将vivotek ip摄像头集成到C#windows应用程序中,camera,ip,Camera,Ip,我开发了一个从vivotek ip摄像头获取视频的应用程序。下面给出了代码,但它显示了连接到10.60.13.12。。。未收到视频 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threadin

我开发了一个从vivotek ip摄像头获取视频的应用程序。下面给出了代码,但它显示了连接到10.60.13.12。。。未收到视频

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using VITAMINDECODERLib;

using AxVITAMINDECODERLib;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        private void btnconnect_Click_1(object sender, EventArgs e)

        {

            string strPreIP = "http://";

            if (txtip.TextLength != 0)
                axVitaminCtrl1.Url = strPreIP + txtip.Text;

            // Port
            axVitaminCtrl1.HttpPort = Convert.ToInt32(txtport.Text);

            // User name
            if (txtusername.TextLength != 0)
                axVitaminCtrl1.UserName = txtusername.Text;

            // Password
            if (txtpass.TextLength != 0)
                axVitaminCtrl1.Password = txtpass.Text;

            // View stream
            axVitaminCtrl1.ViewStream = (VITAMINDECODERLib.EDualStreamOption)comboviewstream.SelectedIndex.GetHashCode();

            // Protocol
            axVitaminCtrl1.ConnectionProtocol = (VITAMINDECODERLib.EConnProtocol)comboprotocol.SelectedIndex.GetHashCode() + 1;

            axVitaminCtrl1.Connect();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            axVitaminCtrl1.Disconnect();
        }

        private void comboviewstream_SelectedIndexChanged(object sender, EventArgs e)
        {
            axVitaminCtrl1.ViewStream = (VITAMINDECODERLib.EDualStreamOption)((System.Windows.Forms.ComboBox)sender).SelectedIndex.GetHashCode();
        }

        private void axVitaminCtrl1_OnVideoCodec(object sender, _IVitaminCtrlEvents_OnVideoCodecEvent e)
        {
            e.eVideoCodec = VITAMINDECODERLib.EVideoCodecType.eViCodecMJpeg;
        }
    }
}
  • 您应该检查调试/发布平台(将其更改为x86)
  • 运行此程序的电脑和相机应具有相同的子网