Re: First frame as keyframe - writing compressed samples
- From: Terry Campbell <tcampbell@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 May 2008 05:45:36 -0700 (PDT)
Jasleen,
If you are sending pre-compressed content to the IWMWriterAdvanced
then make sure that you include the WM_SF_CLEANPOINT flag on your call
to WriteStreamSample - if the sample was compressed as a keyframe
(cleanpoint).
//example for using precompressed frames to writer advanced
DWORD flags = WM_SF_CLEANPOINT; //if flags exists then just |= value
myWriterAdvanced3->WriteStreamSample(streamNumber, timestamp, 0, 0,
flags, myInssBuffer);
If you are sending raw DIB's to the IWMWriter then you can force the
writer to encode the frame as a cleanpoint by
//example for forcing KF on raw input frame to writer
BOOL kf = TRUE;
INSSBuffer *Z = 0;
INSSBuffer3 *myInssBuffer = 0;
IWMWriter->AllocateSample( myFrameSize, &Z);
Z->QueryInterface( IID_INSSBuffer3, (void**)&myInssBuffer );
SAFE_RELEASE(Z);
myInssBuffer->GetBufferAndLength( /*get BYTE* buffer and length*/ );
memcpy( /*copy myframe to the BYTE* buffer*/ );
myInssBuffer->SetProperty(WM_SampleExtensionGUID_OutputCleanPoint,
&kf, sizeof(BOOL)
myWriter->WriteSample(streamNumber, timestamp, 0, myInssBuffer);
If you are using the Writer to encode then you can "tell" the writer
to "force" a cleanpoint at your whim (you could encode every frame as
a keyframe if you wanted); however, if you are pre-encoding your
content using a DMO implementation and simply using the writerAdvanced
to stuff the content into the ASF/WMV transport - then you need to
manage your cleanpoint logic back at the DMO. Setting a "flag" on a
pre-compressed sample when it hits the writerAdvanced will not change
a delta frame into a key frame, it just alerts the writerAdvanced as
to the sample type for indexing etc...
I hope this helps - good luck!
Terry
.
- References:
- First frame as keyframe - writing compressed samples
- From: Jasleen
- First frame as keyframe - writing compressed samples
- Prev by Date: Re: First frame as keyframe - writing compressed samples
- Next by Date: Save Current Play Time
- Previous by thread: Re: First frame as keyframe - writing compressed samples
- Next by thread: WDRM problems: License Acquisition and Individualization
- Index(es):
Relevant Pages
|
Loading