OpenCV中文网站

 找回密码
 立即注册
搜索
热搜: 安装 配置
查看: 3532|回复: 1

纠结了好久了,到底哪出问题了呀?

[复制链接]
发表于 2010-9-28 16:51:22 | 显示全部楼层 |阅读模式
下面是我程序中一段视频存储的代码,现在的问题是录制的视频总是有拖影,看起来有条纹状,真的是纠结了好久了,大家指点下问题出哪了呀?
说明:cvCreateVideoWriter中参数 fourcc我基本都逐一试过了,压缩方式也基本都选择过了

void CWatcherDlg::OnRecord()
{
        if(!nCams)
        {
                AfxMessageBox("Cannot find USB camera!");
                return;
        }
        bRecord = !bRecord;
        if(bRecord && m_bGrabIsStarted)
        {
                CString Cfilename;
                CFileDialog dlg(FALSE,"*.* *.*","",OFN_HIDEREADONLY,"AVI (*.avi)|*.avi",this);
                dlg.m_ofn.lpstrTitle = "Save AVI file";
                if(dlg.DoModal() == IDOK)
                {
                        Cfilename=dlg.GetPathName();
                        sAVIFileName = Cfilename.GetBuffer(MAX_PATH);
                        writer=cvCreateVideoWriter(sAVIFileName, -1, 5, cvSize(320,240));
                        GetDlgItem(IDC_RECORD)->SetWindowText("Stop Rec");
                }
                else
                        bRecord = !bRecord;
        }
        else
        {
                GetDlgItem(IDC_RECORD)->SetWindowText("Record");
                cvReleaseVideoWriter(&writer);
        }
}
回复

使用道具 举报

 楼主| 发表于 2010-9-28 16:55:28 | 显示全部楼层

纠结了好久了,到底哪出问题了呀?

自己先顶一个了。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|OpenCV中文网站

GMT+8, 2024-5-6 12:33 , Processed in 0.008756 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表