Group:  English: Entertainment ยป microsoft.public.windowsmedia.sdk
Thread: WMF 9 SDK writer examples

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

WMF 9 SDK writer examples
feanorgem 13.07.2007 01:02:02
I'm trying to write a WMV file where I generate the video input internally
and then pass each frame to the writer. None of the examples in the Format
SDK are very close to what I'm trying to do so I'm looking for examples in C.
I'm using VS 6 and writing in C. In this one WMV file I'll have one stream in
one profile with one input that is uncompress 24 bit image and have it VBR
quality compressed via the one stream to the writer with WMMEDIASUBTYPE_WMV3
codec. Specifically, I perform the following:

1) WMCreateWriter
2) WMCreateProfileManager
3) CreateEmptyProfile
4) CreateNewStream
5) SetStreamNumber( 1) even though it isn't necessary
6) SetStreamName and SetConnectionName both of which are optional

if I then SetBitrate, then I get an error when I AddStream

7) QueryInterface with IID_IWMVideoMediaProps
8) SetMaxKeyFrameSpacing and SetQuality - are these optional/required?

if I then QueryInterface with IID_IWMMediaProps to allow SetMediaType with
my image parameters then I get an error when I AddStream

9) SetBufferWindow( -1) to let the writer figure out the buffer size
10) QueryInterface with IID_IWMPropertyVault
11) SetProperty with g_wszVBREnabled set TRUE
12) SetProperty with g_wszVBRQuality set to the quality (1-100)
13) SetProperty with g_wszVBRBitrateMax and SetProperty
wszVBRBufferWindowMax both set to zero
14) AddStream
15) SetProfile
16) GetInputProps for input 0
17) SetMediaType with input video format parameters
18) SetInputProps for input 0
19) SetOutputFilename

At this point if I save the profile then the wmmediatype section of the
saved profile does not have the values from step 17.

Also, if I try to QueryInterface with IID_IWMHeaderInfo3 and then
AddAttribute( 1, g_wszWMAuthor...) then I get NS_E_INVALID_REQUEST indicating
invalid stream number.

20) BeginWriting

As soon as I try to WriteSample I get an error that seems to indicate there
is no input definition.

I know everything ahead of time about my input format and have been able to
write AVI files using the same input data but this WMV writing is unclear.
Any help is appreciated, thanks.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net