profile problem
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
profile problem

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
xuxingjian
Guest





Posted: Fri Dec 30, 2005 9:30 am    Post subject: profile problem Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB