Re: First frame as keyframe - writing compressed samples



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
.



Relevant Pages

  • Joseph might apart punish our temper
    ... tackle the initial writer. ... You won't frame me suspending by means of your ... eligible inn. ...
    (sci.crypt)
  • WMV file writer...
    ... I am writing a sample WMV video file writer. ... The problem is that when the video is played, the (Frame) display size ... HRESULT WMVWriter::InitializeWMVwriter(QString wmvFileName, int ... // Set system profile version to 8.0 ...
    (microsoft.public.windowsmedia.encoder)
  • Re: First frame as keyframe - writing compressed samples
    ... property to TRUE for that particular sample, in the DMO wrapper ... frame where property - WM_SampleExtensionGUID_OutputCleanPoint was set. ... WM_SF_CLEANPOINT is set).In this we are using the DMO ... //example for using precompressed frames to writer advanced ...
    (microsoft.public.windowsmedia.sdk)
  • Re: First frame as keyframe - writing compressed samples
    ... WM_SF_CLEANPOINT is set).In this we are using the DMO ... to TRUE for that particular sample, in the DMO wrapper ... //example for using precompressed frames to writer advanced ... //example for forcing KF on raw input frame to writer ...
    (microsoft.public.windowsmedia.sdk)
  • Re: thead sync or string problem
    ... the writer writes to string_command and sets a flag the thread-2 gets ... static semaphore finished; ... void reader() { ...
    (comp.programming.threads)

Loading