Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsoft H.263 codec

14 views
Skip to first unread message

VictorZ

unread,
May 28, 2005, 2:46:33 AM5/28/05
to
Hi all,

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;
}


Thore Karlsen [MVP DX]

unread,
May 28, 2005, 8:45:42 AM5/28/05
to
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.)

--
New to newsgroups? Read: http://dev.6581.com/newsgroups.html

The March Hare [MVP]

unread,
May 28, 2005, 2:57:43 PM5/28/05
to
On Sat, 28 May 2005 07:45:42 -0500, Thore Karlsen [MVP DX] wrote:

> 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

Thore Karlsen [MVP DX]

unread,
May 28, 2005, 5:18:41 PM5/28/05
to
On Sat, 28 May 2005 12:57:43 -0600, "The March Hare [MVP]"
<ph...@ndsm.maps> 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 :)

Indeed! Hadn't looked at the MSDN DS FAQ in a long time. :)

0 new messages