唱片不会在开放的简历中正确录制和播放 [英] record will not record and play correctly in open cv

查看:59
本文介绍了唱片不会在开放的简历中正确录制和播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用opencv并编写下面的代码。我将第二个参数设置为-1。视频将使用"output.avi"记录在Debug文件夹中。名称 。组合框将在运行时显示。我选择了所有项目,但视频无法正常播放。


我认为它没有正确记录,所以无法播放。


I 将媒体播放器控件置于窗体上并尝试"output.avi"但它也不会发挥作用。

 

private void _btn_Record_Click(object sender,EventArgs e)
{
recodClicked = true;
double codec_double = _capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FOURCC);
int Frame_width =(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH);
int Frame_Height =(int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT);
int FrameRate = 15;

VW = new VideoWriter(@"output.avi",-1,(int)FrameRate,Frame_width,Frame_Height,true);
}
private void ProcessFrame()
{
frame = _capture.QueryFrame();

if(recodClicked)
{

VW.WriteFrame(frame);
}
_pic_webcam.Image = frame.ToBitmap();
}
void Application_Idle(object sender,EventArgs e)
{
if(_capture!= null)
{
try
{
ProcessFrame();
}
catch(NullReferenceException excpt)
{
MessageBox.Show(excpt.Message); //你还可以显示任何合适的消息
}
}
}






解决方案

对于这个问题,你应该在这里发帖。


http://sourceforge.net/projects/opencvlibrary/support?source=navbar


chanmm


i use opencv and write below code . i set second parameter to -1 . video will record in Debug folder with "output.avi" name . a combobox will be show at run time. i select all of it's items but video dose not play correctly.

i think it dose not record correctly , so dose not play.

also , i  put a media player control on form and try "output.avi" , but it dose not play too.

private void _btn_Record_Click(object sender, EventArgs e) { recodClicked = true; double codec_double = _capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FOURCC); int Frame_width = (int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH); int Frame_Height = (int)_capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT); int FrameRate = 15; VW = new VideoWriter(@"output.avi", -1, (int)FrameRate, Frame_width, Frame_Height, true); } private void ProcessFrame() { frame = _capture.QueryFrame(); if (recodClicked) { VW.WriteFrame(frame); } _pic_webcam.Image = frame.ToBitmap(); } void Application_Idle(object sender, EventArgs e) { if (_capture != null) { try { ProcessFrame(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message);// you can also show any suitable message } } }



解决方案

For this question you should post in here instead.

http://sourceforge.net/projects/opencvlibrary/support?source=navbar

chanmm


这篇关于唱片不会在开放的简历中正确录制和播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆