Discussion:
AVIIF_KEYFRAME Usage
(too old to reply)
Robert Ferraro
2004-04-15 14:51:27 UTC
Permalink
Hi,

Can anyone give me information regarding "AVIIF_KEYFRAME" (used in
AVIStreamWrite)?

The help file doesn't go into detail regarding its usage--does anyone know
how/why this parameter is used, and if there's a difference when
substituting null in its place?

Thanks,

Robert Ferraro.
Chris P. [MVP]
2004-04-15 15:21:58 UTC
Permalink
Post by Robert Ferraro
Hi,
Can anyone give me information regarding "AVIIF_KEYFRAME" (used in
AVIStreamWrite)?
The help file doesn't go into detail regarding its usage--does anyone
know how/why this parameter is used, and if there's a difference when
substituting null in its place?
It marks the frame as a keyframe, which if a compression codec is being used
will tell the codec to make this frame independent of previous frames so
that it will be instantly "seekable".

If your writing uncompressed files I don't think it makes any difference as
every frame is a keyframe.
Robert Ferraro
2004-04-15 16:38:29 UTC
Permalink
Hi Chris,

Actually, I'm writing compressed frames to an AVI file--in this case, when
would I NOT use the "AVIIF_KEYFRAME" parameter?

Thanks,

Robert.
Post by Chris P. [MVP]
Post by Robert Ferraro
Hi,
Can anyone give me information regarding "AVIIF_KEYFRAME" (used in
AVIStreamWrite)?
The help file doesn't go into detail regarding its usage--does anyone
know how/why this parameter is used, and if there's a difference when
substituting null in its place?
It marks the frame as a keyframe, which if a compression codec is being used
will tell the codec to make this frame independent of previous frames so
that it will be instantly "seekable".
If your writing uncompressed files I don't think it makes any difference as
every frame is a keyframe.
Chris P. [MVP]
2004-04-15 16:47:11 UTC
Permalink
Post by Robert Ferraro
Hi Chris,
Actually, I'm writing compressed frames to an AVI file--in this case,
when would I NOT use the "AVIIF_KEYFRAME" parameter?
You want to only set the AVIIF_KEYFRAME parameter whenever you need a
keyframe (or an extra one). It depends how you are using the API, if you
have already specified a keyframe interval in one of the stuctures during
initialization then there is usually no need to set additional keyframes.
Robert Ferraro
2004-04-15 17:27:31 UTC
Permalink
Post by Chris P. [MVP]
Post by Robert Ferraro
if you have already specified a keyframe interval in one of the
stuctures during initialization...

Are you referring to the AVIMakeCompressedStream call? I pass the following
dwFlags values to AVIMakeCompressedStream: AVICOMPRESSF_KEYFRAMES,
AVICOMPRESSF_VALID (OR'ed together).
Post by Chris P. [MVP]
Post by Robert Ferraro
You want to only set the AVIIF_KEYFRAME parameter whenever you need a
keyframe (or an extra one)...
How do I determine if I need a keyframe or an extra one?


Thanks,

Robert.
Post by Chris P. [MVP]
Post by Robert Ferraro
Hi Chris,
Actually, I'm writing compressed frames to an AVI file--in this case,
when would I NOT use the "AVIIF_KEYFRAME" parameter?
You want to only set the AVIIF_KEYFRAME parameter whenever you need a
keyframe (or an extra one). It depends how you are using the API, if you
have already specified a keyframe interval in one of the stuctures during
initialization then there is usually no need to set additional keyframes.
Chris P. [MVP]
2004-04-15 18:20:22 UTC
Permalink
Post by Robert Ferraro
if you have already specified a keyframe interval in one of the
stuctures during initialization...
Are you referring to the AVIMakeCompressedStream call? I pass the
AVICOMPRESSF_KEYFRAMES, AVICOMPRESSF_VALID (OR'ed together).
Yes, that is correct. Also you must set dwKeyFrameEvery to the interval you
require.
Post by Robert Ferraro
You want to only set the AVIIF_KEYFRAME parameter whenever you need a
keyframe (or an extra one)...
How do I determine if I need a keyframe or an extra one?
If you don't know that you need one, then you don't :)

Loading...