Skip to main content

Vorbis encoder

The VisioForge SDK provides robust support for Vorbis audio encoding across different components and platforms. Vorbis is an open-source audio codec that offers efficient compression while maintaining high audio quality. Understanding the available encoder options and their configuration will help you make the best choice for your audio encoding needs.

Cross-platform Vorbis output (X-engines: VideoCaptureCoreX, VideoEditCoreX, Media Blocks)

Overview

The SDK offers three main ways to work with Vorbis encoding:

  1. WebM output: Provides Vorbis audio encoding as part of WebM container format (Windows-only)
  2. OGG Vorbis output: Dedicated audio-only encoder for OGG container format (Windows-only)
  3. VorbisEncoderSettings: Flexible cross-platform implementation supporting various containers

Each implementation provides different levels of control over the encoding process, suitable for various use cases.

Rate Control Modes

Vorbis encoders support different rate control modes to balance quality and bitrate constraints. Let's explore the available options for each implementation:

Quality-based VBR Mode

Quality-based Variable Bit Rate (VBR) is the recommended mode for most use cases. It allows the encoder to adjust the bitrate dynamically to maintain consistent quality.

WebMOutput uses a simplified quality-based approach, with quality values ranging from 20 (lowest) to 100 (highest).

// Initialize WebM output with high-quality audio settings
var webmOutput = new WebMOutput();

// Set audio quality (range: 20-100)
// Higher values provide better audio quality but larger file sizes
webmOutput.Audio_Quality = 80; // Recommended for high-quality audio

Bitrate-constrained Mode

For scenarios requiring specific bitrate targets or limits, some implementations offer bitrate-controlled encoding.

WebMOutput does not support explicit bitrate control for audio encoding. Use the quality setting instead.

Recommendations

When choosing between encoding modes, consider these guidelines:

  1. For most applications, use Quality mode with VBR:

    • It provides the best balance of quality and file size
    • Easier to configure with just one quality parameter
    • More consistent perceived audio quality
  2. Use Bitrate mode when:

    • You need to target specific file sizes
    • Streaming applications require predictable bandwidth
    • Storage or transmission constraints exist
  3. Start with these recommended values:

    • WebM: Audio_Quality = 80
    • OGG Quality: 80
    • VorbisEncoderSettings Quality: 4
    • For bitrate mode: 128-192 Kbps for stereo music

Remember that higher quality settings or bitrates will result in larger file sizes, so adjust based on your specific needs.