Click here to Skip to main content
12,356,681 members (62,833 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VisualC++
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
Posted 19-Aug-12 17:59pm
Edited 20-Aug-12 11:58am
Wes Aday104.2K
v3
Comments
Praveen S 20-Aug-12 0:34am
   
my profile .prx code is here

[This code is not shown because you did not escape its < > HTML tags -- SA]
...
   
You can put it all in the question using "Improve question" (as well as the code you post as "Solution" -- don't do it, these are not the solutions). Use "encode" menu item on top of edit box to escape HTML characters as character entities &lt; &gt;, etc.
--SA
Praveen S 20-Aug-12 0:48am
   
i had attached my vc++ code and .prx profile code in solution1 and solution 2 respectively,
please help anybody
   
Please don't. Use "Improve question".
--SA
Praveen S 20-Aug-12 1:50am
   
thanks you @ Sergey
i got you.
btw please help me somybody , am stucked with this 3 days since.
TRK3 22-Aug-12 19:48pm
   
Did you check any of the return codes from any of the functions you are calling?

Maybe one of them is failing with a useful error code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 20 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100