Struct Vp8FrameInfo
What a VP8 frame was, as Decode(ReadOnlySpan<byte>) returns it.
public readonly record struct Vp8FrameInfo : IEquatable<Vp8FrameInfo>
- Implements
- Inherited Members
Examples
// VP8 frames in stream order, here from an IVF file (Egami.Video reads WebM and IVF for you).
using Vp8StreamDecoder decoder = new() { ConcealErrors = false };
YuvRaster<byte>? picture = null;
foreach (byte[] packet in IvfFrames("clip.ivf"))
{
Vp8FrameInfo info = decoder.Decode(packet);
if (!info.IsShown)
{
continue; // a hidden frame, typically an alternate reference: it only updates the references
}
picture ??= YuvRaster.Create(info.Width, info.Height, ChromaFormat.Yuv420, YuvColor.Bt601Limited);
decoder.CopyFrameTo(picture); // the picture is the caller's: change it or keep it
shown++;
}
picture?.Dispose();
Constructors
Vp8FrameInfo(bool, bool, int, int, int, bool)
What a VP8 frame was, as Decode(ReadOnlySpan<byte>) returns it.
public Vp8FrameInfo(bool IsKeyFrame, bool IsShown, int Width, int Height, int Version, bool IsConcealed)
Parameters
IsKeyFrameboolWhether the frame is a key frame, which decodes on its own and resets the references.
IsShownboolWhether the frame is shown; a hidden frame (typically an alternate reference) only updates the references.
WidthintThe frame width, from the last key frame.
HeightintThe frame height, from the last key frame.
VersionintThe VP8 version, 0 to 3: 0 uses the six-tap prediction filters and the normal loop filter, 1 to 3 simpler ones.
IsConcealedboolWhether ConcealErrors concealed broken data in this frame.
Examples
// VP8 frames in stream order, here from an IVF file (Egami.Video reads WebM and IVF for you).
using Vp8StreamDecoder decoder = new() { ConcealErrors = false };
YuvRaster<byte>? picture = null;
foreach (byte[] packet in IvfFrames("clip.ivf"))
{
Vp8FrameInfo info = decoder.Decode(packet);
if (!info.IsShown)
{
continue; // a hidden frame, typically an alternate reference: it only updates the references
}
picture ??= YuvRaster.Create(info.Width, info.Height, ChromaFormat.Yuv420, YuvColor.Bt601Limited);
decoder.CopyFrameTo(picture); // the picture is the caller's: change it or keep it
shown++;
}
picture?.Dispose();
Properties
Height
The frame height, from the last key frame.
public int Height { get; init; }
Property Value
IsConcealed
Whether ConcealErrors concealed broken data in this frame.
public bool IsConcealed { get; init; }
Property Value
IsKeyFrame
Whether the frame is a key frame, which decodes on its own and resets the references.
public bool IsKeyFrame { get; init; }
Property Value
IsShown
Whether the frame is shown; a hidden frame (typically an alternate reference) only updates the references.
public bool IsShown { get; init; }
Property Value
Version
The VP8 version, 0 to 3: 0 uses the six-tap prediction filters and the normal loop filter, 1 to 3 simpler ones.
public int Version { get; init; }
Property Value
Width
The frame width, from the last key frame.
public int Width { get; init; }