Skip to main content

WebM file output

Products: Video Capture SDK .Net, Video Edit SDK .Net

WebM: WebM is an open, royalty-free media file format designed for the web. Introduced in 2010, it was developed by Google to provide high-quality video streaming with low computational overhead. WebM is optimized for use with HTML5 and supports VP8 and VP9 video codecs and Vorbis and Opus audio codecs.

You must configure the output format using the WebMOutput class to capture video in WebM format. You can use dialog to set settings in UI or set settings in code.

The same sample code can be used for Video Edit SDK .Net. Use the VideoEditCore class instead of VideoCaptureCore.

Sample code

Create WebMOutput object

var webmOutput = new WebMOutput();

Set WebM settings using the settings dialog

WebMSettingsDialog settingsDialog = new WebMSettingsDialog();
settingsDialog.ShowDialog(this);
settingsDialog.SaveSettings(ref webmOutput);

Or

Set WebM settings without using the settings dialog (basic sample)

webmOutput.Video_Mode = VP8QualityMode.Realtime;
webmOutput.Video_EndUsage = VP8EndUsageMode.VBR;
webmOutput.Video_Encoder = WebMVideoEncoder.VP8;
webmOutput.Video_Bitrate = 2000;

webmOutput.Audio_Quality = 80;

Apply settings

Set WebM format settings for output

VideoCapture1.Output_Format = webmOutput;

Set the video capture mode

VideoCapture1.Mode = VideoCaptureMode.VideoCapture;

Set the file name (be sure that you have to write access rights)

VideoCapture1.Output_Filename = "output.webm";

Start capture (sync or async)

await VideoCapture1.StartAsync();

Required redists

  • Video Capture SDK redist x86 x64
  • Video Edit SDK redist x86 x64

How can the required redists be installed or deployed to the user's PC?


Visit our GitHub page to get more code samples.