Is there a sample how to use Microsoft's H.263 codec. For some reason it
does not work for us. We open the codec, get output format for input RGB24
format with CIF size. After that ICCompressQuery and ICCompressBegin for
some reason fail. I suspect we have to initialize it by ICSetState with
non-undocumented configuration data.
I would appreciate any suggestions. Code sample follows. Very similar code
works with other codecs just fine.
Thanks,
Victor
#include <windows.h>
#include <Vfw.h>
int main(int argc,char *argv[])
{
BITMAPINFO biIn = {0};
biIn.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
biIn.bmiHeader.biWidth = 176;
biIn.bmiHeader.biHeight = 144;
biIn.bmiHeader.biPlanes = 1;
biIn.bmiHeader.biBitCount = 24;
biIn.bmiHeader.biCompression = BI_RGB;
biIn.bmiHeader.biSizeImage =
biIn.bmiHeader.biWidth*biIn.bmiHeader.biBitCount/8*biIn.bmiHeader.biHeight;
HIC hic = ICOpen(ICTYPE_VIDEO,'362m',ICMODE_COMPRESS);
if(hic == 0)
return 0;
ICINFO icinfo;
DWORD dw = ICGetInfo(hic,&icinfo,sizeof(icinfo));
dw = ICCompressGetFormatSize(hic,&biIn);
if((long)dw > 0)
{
BITMAPINFO* pbiOut = (BITMAPINFO*)malloc(dw);
dw = ICCompressGetFormat(hic,&biIn,pbiOut);//returns ICERR_OK
dw = ICCompressQuery(hic,&biIn,pbiOut);//returns ICERR_UNSUPPORTED
dw = ICCompressBegin(hic,&biIn,pbiOut);//returns ICERR_UNSUPPORTED
if(dw == ICERR_OK)
ICCompressEnd(hic);
if(pbiOut)
free(pbiOut);
}
if(hic)
ICClose(hic);
return 0;
}
>Is there a sample how to use Microsoft's H.263 codec. For some reason it
>does not work for us.
You're not supposed to use it in your applications, it's intended for
use by Microsoft only. (In Netmeeting, IIRC.)
--
New to newsgroups? Read: http://dev.6581.com/newsgroups.html
> On Sat, 28 May 2005 02:46:33 -0400, "VictorZ"
> <vzhodzishsky.comunity.nospam> wrote:
>
>>Is there a sample how to use Microsoft's H.263 codec. For some reason it
>>does not work for us.
>
> You're not supposed to use it in your applications, it's intended for
> use by Microsoft only. (In Netmeeting, IIRC.)
As stated in the docs :)
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
>>>Is there a sample how to use Microsoft's H.263 codec. For some reason it
>>>does not work for us.
>> You're not supposed to use it in your applications, it's intended for
>> use by Microsoft only. (In Netmeeting, IIRC.)
>As stated in the docs :)
Indeed! Hadn't looked at the MSDN DS FAQ in a long time. :)