C#中的视频到帧提取
本文关键字:提取 的视频 | 更新日期: 2023-09-27 18:24:54
我正试图在visual studio 2010上用C#运行一个从视频中提取帧的小型应用程序。我的windows操作系统是32位的。
当我试图构建解决方案时,它给了我以下警告:
"正在构建的项目的处理器体系结构"MSIL"与引用"MWArray,版本=2.12.0.0,culture=neural,publicKeyToken=e1d84a0da19db86f,processorArchitecture=AMD64,"x86"的处理器体系架构不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改项目的目标处理器体系结构,以便使项目和引用之间的处理器体系结构保持一致,或者使用与项目目标处理器体系架构匹配的处理器体系架构来依赖引用。"
编辑:
现在我尝试将项目配置更改为x86。现在警告消失了。
我试着开始调试程序,结果出现错误。未处理TypeInitializationException。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using finalNative;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
namespace check
{
public partial class Form1 : Form
{
finalNative.edit mtb = new finalNative.edit(); // ... >>here is the error message
static object Val;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Select File ";
fdlg.Filter = "All files (*.*)|*.*|All files (*.avi)|*.avi";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
fdlg.ShowDialog();
if (fdlg.FileName != string.Empty)
{
textBox1.Text = fdlg.FileName;
}
else
{
textBox1.Text = "Please Select .avi file before submit the form ! ";
Val = textBox1.Text;
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text != String.Empty)
{
mtb.frames(textBox1.Text);
makeframe.Enabled = false;
label2.Enabled = false;
MessageBox.Show("Video Converted into Frames!");
}
}
private void button3_Click(object sender, EventArgs e)
{
mtb.formating(textBox1.Text);
MessageBox.Show("Frames Color Should be changed and Saved !");
formating.Enabled = false;
label3.Enabled = false;
}
private void makevideo_Click(object sender, EventArgs e)
{
mtb.makevideo(textBox1.Text);
MessageBox.Show("Video Creation complete And Saved with Name "+"resultant video.avi");
makevideo.Enabled = false;
label4.Enabled = false;
}
private void exit_Click(object sender, EventArgs e)
{
this.Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
这就是您应该做的:
请考虑更改您的目标处理器体系结构通过配置管理器进行项目,以便调整处理器项目和引用之间的体系结构,或者采用依赖关系使用与目标匹配的处理器体系结构的引用项目的处理器体系结构。
请在此处阅读有关异常的信息。