| Author |
Message |
xuxingjian
Guest
|
Posted:
Fri Dec 30, 2005 9:30 am Post subject:
profile problem |
|
|
I have encode a wmv file "test1.wmv" with WMProfile_V80_768Video
profile.and I want to copy the stream to another file "test2.wmv" .So I set
the write
profile .
hr = m_pWriter->SetProfileByID(WMProfile_V80_768Video);
When write done,media player can not play test2.wmv,say
"unknow format".
but if i read the profile date from test1.wmv and set
it to the write, it work fine
hr = m_pReader->Open(CComBSTR("test2.wmv", this, NULL );
hr = m_pReader->QueryInterface( IID_IWMProfile, ( VOID ** )&pProfile );
hr = m_pWriter->SetProfile( pProfile );
And I have try SaveProfile , LoadProfileByData ,it can not work too.
Is there any undocument data in IWMProfile ?
xuxingjian
|
|
| Back to top |
|
 |
Alessandro Angeli [MVP::D
Guest
|
Posted:
Fri Dec 30, 2005 5:30 pm Post subject:
Re: profile problem |
|
|
xuxingjian wrote:
[CUT]
| Quote: | Is there any undocument data in IWMProfile ?
|
There is an undocumented DWORD appended to the
VIDEOINFOHEADER structure that won't be correct unless you
copy the profile alongside the data. That may be the
problem, I don't know for sure.
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net |
|
| Back to top |
|
 |
xuxingjian
Guest
|
Posted:
Sat Dec 31, 2005 1:30 am Post subject:
Re: profile problem |
|
|
Thanks for you reply.
But how to copy this data from IWMProfile?
I am not good at COM interface.
"Alessandro Angeli [MVP::DigitalMedia]" <nobody@nowhere.in.the.net> дÈëÓʼþ
news:%230ujFrUDGHA.528@TK2MSFTNGP09.phx.gbl...
| Quote: | xuxingjian wrote:
[CUT]
Is there any undocument data in IWMProfile ?
There is an undocumented DWORD appended to the
VIDEOINFOHEADER structure that won't be correct unless you
copy the profile alongside the data. That may be the
problem, I don't know for sure.
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net
|
|
|
| Back to top |
|
 |
xuxingjian
Guest
|
Posted:
Sat Dec 31, 2005 9:30 am Post subject:
Re: profile problem |
|
|
I have copy the videohead like this:
for ( DWORD i = 0; i < dwStreams; i++ )
{
IWMStreamConfig *pConfig;
WM_MEDIA_TYPE *pType;
IWMMediaProps *pProps=NULL;
DWORD cbType;
hr= pProfile2->GetStream(i,&pConfig);
hr=pConfig->QueryInterface(IID_IWMMediaProps,(void **)&pProps);
hr=pProps->GetMediaType( NULL, &cbType);
pType = (WM_MEDIA_TYPE*) new BYTE[cbType];
hr=pProps->GetMediaType( pType, &cbType);
hr= pProfile->GetStream(i,&pConfig);
hr=pConfig->QueryInterface(IID_IWMMediaProps,(void **)&pProps);
hr=pProps->SetMediaType(pType);
}
but if i use
hr = m_pWriter->SetProfile( pProfile );
it doesn't work. |
|
| Back to top |
|
 |
Alessandro Angeli [MVP::D
Guest
|
Posted:
Sat Dec 31, 2005 9:30 am Post subject:
Re: profile problem |
|
|
xuxingjian wrote:
| Quote: | Thanks for you reply.
But how to copy this data from IWMProfile?
I am not good at COM interface.
|
COM has nothing to do with it. You need to set the profile
on the writer and you must read the profile from the reader,
that's it. If you load an empty profile or a system profile
or anything else, the DWORD at the end of the
VIDEOINFOHEADER will not have the correct value. If you want
to use a profile other than the profile you get from the
reader, just remember to manually configure the video media
type so that you can copy the DWORD fron the reader's
profile yourself.
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net |
|
| Back to top |
|
 |
Alessandro Angeli [MVP::D
Guest
|
Posted:
Sat Dec 31, 2005 9:30 am Post subject:
Re: profile problem |
|
|
xuxingjian wrote:
| Quote: | but if i use
hr = m_pWriter->SetProfile( pProfile );
it doesn't work.
|
That was the only idea I had.
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net |
|
| Back to top |
|
 |
|
|
|
|