AVIStreamGetFrameOpen()返回NULL [英] AVIStreamGetFrameOpen() returns NULL

查看:238
本文介绍了AVIStreamGetFrameOpen()返回NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试从AVI文件中提取BMP中的帧.我正在使用Vfw.h和Visual Studio2010.我正在使用c ++.我的项目是控制台win32应用程序.

其余功能运行正常,但AVIStreamGetFrameOpen()失败

Hi,
I am trying to extract a frame in BMP from AVI files. I am using Vfw.h and visual studio 2010. I am using c++. My project is a console win32 application.

Rest of the functions are working fine but AVIStreamGetFrameOpen()is failing

AVIFileInit();

//pointer to avi file
PAVIFILE pAviFile;

//open AVI file
result = AVIFileOpen(&pAviFile,path,OF_READ,NULL);
if(result != AVIERR_OK)
{
    if(pAviFile)
        AVIFileRelease(pAviFile);
    AVIFileExit();
    return false;
}

//read info
result = AVIFileInfo(pAviFile,&aviFileInfo,sizeof(AVIFILEINFO));
if(result != 0)
{
    if(pAviFile)
        AVIFileRelease(pAviFile);
    AVIFileExit();
    return false;
}

//get first video stream
result = AVIFileGetStream(pAviFile,&pAviStream,streamtypeVIDEO,0);
if(result != AVIERR_OK)
{
    if(pAviStream)
        AVIStreamRelease(pAviStream);
    AVIFileExit();
    return false;
}

pAviStreamFrame = AVIStreamGetFrameOpen(pAviStream,NULL/*(BITMAPINFOHEADER*)AVIGETFRAMEF_BESTDISPLAYFMT);*/



AVIStreamGetFrameOpen返回NULL.我曾尝试搜索,但尚未找到任何解决方案.

请帮忙.

我正在使用Windows 7 x64.



AVIStreamGetFrameOpenreturns NULL. I have tried to search But havent found any solution.

Please help.

I am using windows 7 x64.

推荐答案

如果系统找不到可以将流解压缩为给定格式或任何RGB格式的解压缩器,则该函数返回NULL."

您是否检查过系统是否可以使用Windows Media Player打开该avi文件?

也许缺少特定于Vcc的VfW兼容编解码器...
"If the system cannot find a decompressor that can decompress the stream to the given format, or to any RGB format, the function returns NULL."

Have you checked that your system can open this avi file with Windows Media Player ?

Maybe a VfW compliant codec is missing for this particular fourcc...


这篇关于AVIStreamGetFrameOpen()返回NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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