i was using profile (.prx) to write video bufer to wmv video format file by using the LoadProfileByData... work's fine for 320*240 biwidth and biheight repectively.
if i changed the values to other than320*240 for ex 640*480 it crates wmv file of 2.52kb constantly but the file is empty, no video buffer inside, the property of this wmv file shows 640*480 resolution.
i had tried by changing the following values in the profile .prx file
biwidth, biheight to 640*480,
rcsource & rctargetto 640*480
bi compression from wmv1 to wmv2 or wmv3 and simeltaeously wmmediatype subtype & streamconfig majortype
also tried by changin profile version too..
also tried changing the vc++ code SetSystemProfileVersion(WMT_VER_8_0);to
WMT_VER_9_0
but everything results in failure the same 2.52kb empty wmv file with 640*480 resolution.
but by using LoadSystemProfile , i can change the resolution to anything 176*144,...640*480 to 1024*768 by changing the biwidth and biheight in WMSysPr9.prx in windows32 folder.
anybody please help me
my code vc++ is follows
STDMETHODIMP Cs_cl_cam::videorecord_profile(BSTR path, LONG bitrate)
{
WMT_VERSION WMVersion;
HRESULT hr;
IWMProfileManager *ProfManager=NULL;
IWMProfileManager2 *ProfManager2=NULL;
int buff_Count = 0;
hr = WMCreateWriter(NULL,&Writer);
IWMProfileManagerLanguage *ProfManagerLang;
hr = WMCreateProfileManager(&ProfManager);
ProfManager2 = (IWMProfileManager2*)ProfManager;
ProfManagerLang = (IWMProfileManagerLanguage*)ProfManager;
hr = ProfManager2->GetSystemProfileVersion(&WMVersion);
hr = ProfManager2->SetSystemProfileVersion(WMT_VER_8_0);
string bs,path1,path2;
switch (bitrate)
{
case 100:
bs="100";
break;
case 200:
bs="200";
break;
case 300:
bs="300";
break;
case 400:
bs="400";
break;
default:
bs="100";
break;
}
path1="c:\\Profiles\\";
path2=path1+bs+"kbps_v.prx";
FILE *fp = fopen(path2.c_str(),"r");
fseek(fp,0,SEEK_END);
long nBytes = ftell(fp);
rewind(fp);
char* ProfString = (char*)malloc(sizeof(char)*nBytes);
fread(ProfString,sizeof(char),nBytes,fp);
WCHAR* ProfLoadStr = (WCHAR*)ProfString;
fclose(fp);
hr = ProfManager2->LoadProfileByData(ProfLoadStr,&Profile);
hr = Writer->SetProfile(Profile);
hr = Writer->SetOutputFilename(path);
hr = Writer->BeginWriting();
buff_Count = 0;
SampleTime=0;
CollectSamples = TRUE;
return S_OK;
}
and my custamized profile am using is goes here
<profile version="589824"
storageformat="1"
name="100kbps_v"
description="">
<streamconfig majortype="{73646976-0000-0010-8000-00AA00389B71}"
streamnumber="1"
streamname="Video Stream"
inputname="Video409"
bitrate="100000"
bufferwindow="-1"
reliabletransport="0"
decodercomplexity="AU"
rfc1766langid="en-us"
>
<videomediaprops maxkeyframespacing="80000000"
quality="80"/>
<wmmediatype subtype="{31564D57-0000-0010-8000-00AA00389B71}"
bfixedsizesamples="0"
btemporalcompression="1"
lsamplesize="0">
<videoinfoheader dwbitrate="100000"
dwbiterrorrate="0"
avgtimeperframe="1000000">
<rcsource left="0"
top="0"
right="320"
bottom="240"/>
<rctarget left="0"
top="0"
right="320"
bottom="240"/>
<bitmapinfoheader biwidth="320"
biheight="240"
biplanes="1"
bibitcount="24"
bicompression="WMV1"
bisizeimage="0"
bixpelspermeter="0"
biypelspermeter="0"
biclrused="0"
biclrimportant="0"/>
</videoinfoheader>
</wmmediatype>
</streamconfig>
<streamconfig majortype="{73636D64-0000-0010-8000-00AA00389B71}"
streamnumber="2"
streamname="Script Stream"
inputname="Script409"
bitrate="4000"
bufferwindow="-1"
reliabletransport="0"
decodercomplexity=""
rfc1766langid="en-us"
>
<wmmediatype subtype="{00000000-0000-0000-0000-000000000000}"
bfixedsizesamples="0"
btemporalcompression="0"
lsamplesize="0">
<WMSCRIPTFORMAT scripttype="{82F38A70-C29F-11D1-97AD-00A0C95EA850}"/>
</wmmediatype>
</streamconfig>
<streamprioritization>
<stream number="1" mandatory="0"/>
<stream number="2" mandatory="0"/>
</streamprioritization>
</profile>
anybody please help me to set 640*480 resolution