#camera #ip
#камера #ip
Вопрос:
я разрабатываю приложение для получения видео из vivotek ip camera
кода, приведенного ниже, но оно показывает подключение к 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;
}
}
}
Ответ №1:
- Вы должны проверить платформу отладки / выпуска (измените ее на x86)
- Ваш компьютер, на котором запущена эта программа, и камера должны иметь одну и ту же подсеть