aforge

基于FFmpeg的视频播放控件 WPF 支持调整进度

余生颓废 提交于 2020-05-02 12:25:50
前一段时间用wpf做视频监控的项目,需要做一个视频回放的功能,使用.net自带的那个媒体控件貌似不能满足要求,所以希望寻找一个基于FFMpeg的视频播放库,可以播放任何格式的视频。 用过AForge的库的朋友都知道里面Video.FFMPEG命名空间内有一个VideoFileReader,但是这个Reader只能向前读。不能支持进度跳转。所来学习了一下他的源代码,在原有的基础上添加了一个 JumpTo(double pos)函数 pos表示归一化的位置参数,范围为0~1.另外写了一个demo,在这里共享一下 希望对大家有用。 效果图 欢迎光临 淘宝小店:netxeye.taobao.com 进入网店资源分享页,下载工程示例: 链接: https://pan.baidu.com/s/1t2h2t_lT0-OqMNahQikH0w 提取码: xp8n 来源: oschina 链接: https://my.oschina.net/u/4347922/blog/4262020

C#获取设备(Audio和Video)名称 简单整理

孤街浪徒 提交于 2020-04-12 15:11:45
直接上测试代码和运行结果 static void Main(string[] args) { #region 测试代码 List<string> dataList; dataList = DirectXHelper.GetAudioDevicesList(); OutPutInfo("DirectX获取麦克风:", dataList); dataList = NAudioHelper.GetInDeviceList(); OutPutInfo("NAudio获取麦克风", dataList); dataList = NAudioHelper.GetInDeviceListFull(); OutPutInfo("NAudio获取麦克风完整名称", dataList); dataList = NAudioHelper.GetOutDeviceList(); OutPutInfo("NAudio获取扬声器", dataList); dataList = NAudioHelper.GetOutDeviceListFull(); OutPutInfo("NAudio获取扬声器完整名称", dataList); dataList = AForgeHelper.GetAudioInDevicesList(); OutPutInfo("AForge获取麦克风", dataList);

Memory Leak from ImageSource/CreateBitmapSourceFromHBitmap (while capturing webcam with AForge)

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 04:06:12
问题 I am trying to output whatever is captured from a webcam to an Image control in a WPF window. I am using the AForge.NET library. Unfortunately, after a few minutes of successful capturing, I am getting an OutOfMemoryException. Likewise, as soon as I start capturing, I can see my memory usage rise continuously in the task manager until the moment of the exception (although there have been a few occasions where memory usage kept rising, then steeply dropped back to its original state, and then

How can I identify the color of the letters in these images?

倖福魔咒の 提交于 2020-01-04 02:41:14
问题 I am using this article to solve captchas. It works by removing the background from the image using AForge, and then applying Tesseract OCR to the resulting cleaned image. The problem is, it currently relies on the letters being black, and since each captcha has a different text color, I need to either pass the color to the image cleaner, or change the color of the letters to black. To do either one, I need to know what the existing color of the letters is. How might I go about identifying

The type exists in both DLLs

泄露秘密 提交于 2020-01-03 11:33:13
问题 I wanted to use something from Accord library as well as the AForge library. But when I installed it, I started getting the following error: Error CS0433 The type 'IntPoint' exists in both 'AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb' and 'Accord, Version=3.0.2.0, Culture=neutral, PublicKeyToken=fa1a88e29555ccf7' On this line of code: startingPoint = new IntPoint(point.X, point.Y); How can I ensure that I only use the original AForge DLL for this? Is there

Frame-by-frame MJPEG streaming with C#/ASP.NET MVC

懵懂的女人 提交于 2020-01-01 14:57:54
问题 I have been trying to setup a MJPEG stream in ASP.NET. I want to retrieve a MJEPG stream from a URL, and send every frame that I get to every connected client. Examples that I have been able to find only read from a set file, instead of a continues stream from URL, and send the entire file through MultiStreamContent . Since I retrieve frame-by-frame, I cannot do this. I would like to know if it is possible to do what I want with ASP.NET MVC. I'm currently using AForge video to retrieve the

Get Webcam stream using Aforge.NET in C# and WPF

半腔热情 提交于 2020-01-01 04:37:07
问题 I want to capture a webcam feed using my camera. For that I am using the 2 references: AForge.Video.dll and AForge.Video.DirectShow.dll . Here's a snippet I found: public FilterInfoCollection CamsCollection; public VideoCaptureDevice Cam = null; void Cam_NewFrame(object sender, NewFrameEventArgs eventArgs) { frameholder.Source = (Bitmap)eventArgs.Frame.Clone(); /* ^ * Here it cannot convert implicitly from System.Drawing.Bitmap to * System.Windows.Media.ImageSource */ } private void startcam

How to find the best parameters for a Genetic Algorithm?

杀马特。学长 韩版系。学妹 提交于 2020-01-01 03:31:22
问题 Some Genetic Algorithm frameworks, such as http://www.aforgenet.com/ requires many parameters, such as mutation rate, population size, etc There is universal best numbers for such parameters? I believe that it depends on the problem (fitness function delay, mutation delay, recombination delay, evolution rate, etc). My first thought was to use a GA to configure another GA. Any better ideas? 回答1: The one time I programmed a genetic algorithm I included those values in the values to mutate,

Performing multiple image averaging in c#

风格不统一 提交于 2019-12-25 18:24:23
问题 I wish to calculate an average image from 3 different images of the same size that I have. I know this can be done with ease in matlab..but how do I go about this in c#? Also is there an Aforge.net tool I can use directly for this purpose? 回答1: I have found an article on SO which might point you in the right direction. Here is the code (unsafe) BitmapData srcData = bm.LockBits( new Rectangle(0, 0, bm.Width, bm.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); int stride = srcData

Neural Network on Windows Phone 8.0

[亡魂溺海] 提交于 2019-12-25 12:51:42
问题 I am trying neural network application on Windows Phone 8. And I am writing below code: ActivationNetwork network = null; //global variable network = new ActivationNetwork( new BipolarSigmoidFunction(2), //aktivation func. 9, //input count 20, //hidden layer count 1 //output count ); This code working on desktop project.(C#) But not working Windows Phone 8. This is Aforge Framework's function. I installed via nuget. When I clicked run I am getting error. My error code: An exception of type