Skip to main content

Theora encoder

The Theora encoder is used to encode video files in WebM format.

Block info

Name: TheoraEncoderBlock.

Pin directionMedia typePins count
InputUncompressed video1
Outputvideo/x-theora1

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline(false);

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

var theoraEncoderBlock = new TheoraEncoderBlock(new TheoraEncoderSettings());
pipeline.Connect(fileSource.VideoOutput, theoraEncoderBlock.Input);

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

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.