Skip to main content

VPX encoder

VPX encoder block is used to encode files in WebM, MKV, or OGG files. VPX encoder is a set of video codecs for encoding in VP8 and VP9 formats.

Use classes that implement the IVPXEncoderSettings interface to set the parameters.

Settings

VP8EncoderSettings

VP8 CPU encoder.

VP9EncoderSettings

VP9 CPU encoder.

Block info

Name: VPXEncoderBlock.

Pin directionMedia typePins count
InputUncompressed video1
OutputVP8/VP91

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

var filename = "test.mp4";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));

var vp8EncoderBlock = new VPXEncoderBlock(new VP8EncoderSettings());
pipeline.Connect(fileSource.VideoOutput, vp8EncoderBlock.Input);

var webmSinkBlock = new WebMSinkBlock(new WebMSinkSettings(@"output.webm"));
pipeline.Connect(vp8EncoderBlock.Output, webmSinkBlock.CreateNewInput(MediaBlockPadMediaType.Video));

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.