首页上一页 1 下一页尾页 1 条记录 1/1页
关于:visual c++视频技术方案宝典
发表在C语言图书答疑
2010-08-20
是否精华
是
否
版块置顶:
是
否
我现在在看visual c++视频技术方案宝典这本书,第2章2.2.6视频录像设计方案是通过VFW的回调函数录像,但是程序运行之后点击录像,马上弹出“压缩失败”的对话框,这个是怎么回事?
还有我能不能不用压缩直接存储视频呢?我就是想不压缩直接存储视频,您能不能给我提供点建议
if (ICCompress(pDlg->m_Com.hic, 0, &pDlg->m_OutInfo.bmiHeader, buffer, &pDlg->m_InInfo.bmiHeader, (unsigned char *)lpVHdr->lpData, &dwCkID, &dwCompFlags, pDlg->m_Frame++,0, dwQuality, NULL, NULL) == ICERR_OK)这个函数我不懂什么意思?
LRESULT WINAPI EncodeCallback(HWND hWnd, LPVIDEOHDR lpVHdr)
{
CVideoEncodeDlg* pDlg = (CVideoEncodeDlg*)AfxGetMainWnd();
if ((pDlg->m_Captured) && (lpVHdr->dwFlags&VHDR_DONE))
{
char* buffer = new char [lpVHdr->dwBytesUsed+1];
memset(buffer,0,lpVHdr->dwBytesUsed+1);
DWORD dwCkID ;
DWORD dwCompFlags ;
DWORD dwQuality = 100;
//视频压缩
if (ICCompress(pDlg->m_Com.hic, 0, &pDlg->m_OutInfo.bmiHeader, buffer, &pDlg->m_InInfo.bmiHeader,
(unsigned char *)lpVHdr->lpData, &dwCkID, &dwCompFlags, pDlg->m_Frame++,0, dwQuality, NULL, NULL) == ICERR_OK)
{
AVIStreamSetFormat(pDlg->ps,pDlg->m_Frame,&pDlg->m_OutInfo,sizeof(pDlg->m_OutInfo));
AVIStreamWrite(pDlg->ps,pDlg->m_Frame ,1, (LPBYTE) buffer,pDlg->m_OutInfo.bmiHeader.biSizeImage ,AVIIF_KEYFRAME,
NULL,NULL);
}
delete []buffer;
}
return 1;
}
还有我能不能不用压缩直接存储视频呢?我就是想不压缩直接存储视频,您能不能给我提供点建议
if (ICCompress(pDlg->m_Com.hic, 0, &pDlg->m_OutInfo.bmiHeader, buffer, &pDlg->m_InInfo.bmiHeader, (unsigned char *)lpVHdr->lpData, &dwCkID, &dwCompFlags, pDlg->m_Frame++,0, dwQuality, NULL, NULL) == ICERR_OK)这个函数我不懂什么意思?
LRESULT WINAPI EncodeCallback(HWND hWnd, LPVIDEOHDR lpVHdr)
{
CVideoEncodeDlg* pDlg = (CVideoEncodeDlg*)AfxGetMainWnd();
if ((pDlg->m_Captured) && (lpVHdr->dwFlags&VHDR_DONE))
{
char* buffer = new char [lpVHdr->dwBytesUsed+1];
memset(buffer,0,lpVHdr->dwBytesUsed+1);
DWORD dwCkID ;
DWORD dwCompFlags ;
DWORD dwQuality = 100;
//视频压缩
if (ICCompress(pDlg->m_Com.hic, 0, &pDlg->m_OutInfo.bmiHeader, buffer, &pDlg->m_InInfo.bmiHeader,
(unsigned char *)lpVHdr->lpData, &dwCkID, &dwCompFlags, pDlg->m_Frame++,0, dwQuality, NULL, NULL) == ICERR_OK)
{
AVIStreamSetFormat(pDlg->ps,pDlg->m_Frame,&pDlg->m_OutInfo,sizeof(pDlg->m_OutInfo));
AVIStreamWrite(pDlg->ps,pDlg->m_Frame ,1, (LPBYTE) buffer,pDlg->m_OutInfo.bmiHeader.biSizeImage ,AVIIF_KEYFRAME,
NULL,NULL);
}
delete []buffer;
}
return 1;
}