-
-
Save visioforge/96e7ccf8ce684de01be8b4f1a785a21e to your computer and use it in GitHub Desktop.
// Required NuGet packages: | |
// https://www.nuget.org/packages/VisioForge.DotNet.VideoCapture/ | |
// https://www.nuget.org/packages/VisioForge.DotNet.Core.Redist.VideoCapture.x64/ | |
// https://www.nuget.org/packages/VisioForge.DotNet.Core.Redist.VideoCapture.x86/ | |
// https://www.nuget.org/packages/VisioForge.DotNet.Core.Redist.LAV.x64/ | |
// https://www.nuget.org/packages/VisioForge.DotNet.Core.Redist.LAV.x86/ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using VisioForge.Types.OutputFormat; | |
using VisioForge.Types.VideoEffects; | |
namespace SampleCapture | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
videoCapture1.OnError += OnError; | |
} | |
private void btStart_Click(object sender, EventArgs e) | |
{ | |
videoCapture1.IP_Camera_Source = new VisioForge.Types.Sources.IPCameraSourceSettings() { URL = "http://192.168.233.129:8000/camera/mjpeg", Type = VisioForge.Types.VFIPSource.Auto_LAV }; | |
videoCapture1.Audio_PlayAudio = videoCapture1.Audio_RecordAudio = false; | |
videoCapture1.Mode = VisioForge.Types.VFVideoCaptureMode.IPPreview; | |
videoCapture1.Start(); | |
} | |
private void btStop_Click(object sender, EventArgs e) | |
{ | |
videoCapture1.Stop(); | |
} | |
private void OnError(object sender, ErrorsEventArgs e) | |
{ | |
System.Diagnostics.Debug.WriteLine(e.Message); | |
} | |
} | |
} |
Thanks a lot, it worked!
URL = "http://192.168.233.129:8000/camera/mjpeg
camera - Is it camera name?
Camera URL.
When debug code as in video I get message: "You can see this window because OnError event is not implemented in your code. Implement OnError event to see errors, create empty handler to ignore all errors.
Unable to create LAV Splitter Source filter. Please be sure that LAV filters installed.
Unable to open IP camera stream. Please check URL. Remember, you're need direct video URL, not just IP address."
Please install SDK from product page or add the following NuGet packages: VisioForge.DotNet.VideoCapture.TRIAL, VisioForge.DotNet.Core.Redist.VideoCapture.x64, VisioForge.DotNet.Core.Redist.LAV.x64.
I've installed NuGet packages: VisioForge.DotNet.VideoCapture.TRIAL, VisioForge.DotNet.Core.Redist.VideoCapture.x64, VisioForge.DotNet.Core.Redist.LAV.x64. But I have error: Unable to create filter: LAV Splitter Source
Не удалось получить фабрику класса COM для компонента с CLSID {B98D13E7-55DB-4385-A33D-09FD1BA26338} из-за следующей ошибки: 80040154 Класс не зарегистрирован (Исключение из HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Unable to create LAV Splitter Source filter. Please be sure that LAV filters installed.
Unable to open IP camera stream. Please check URL. Remember, you're need direct video URL, not just IP address.
What does this mean?
If your app started as x64 that should work. For x86 app you can add x86 NuGet packages.
videoCapture lose from tools
videoCapture lose from tools
What do you mean?
I have x64 Windows and this program doesn't work
May be that is because I have login and password but I don't know where them to insert in code
Yes, if your camera require login/password.
Login/password can be set in videoCapture1.IP_Camera_Source property.
Please check https://github.com/visioforge/.Net-SDK-s-samples/tree/master/Video%20Capture%20SDK/WinForms/CSharp/IP%20Capture demo.
videoCapture lose from tools
What do you mean?
This videoCapture tool is missing. I couldn't get it
VisioForge.DotNet.VideoCapture.TRIAL NuGet package have VideoCapture class.
Hello sir ,
i tried it , but i got some errors.
like:-
You can see this window because OnError event is not implemented in your code. Implement OnError event to see errors, create empty handler to ignore all errors.
Unable to connect main screen filter to video output pin.
plz help