Table of Contents

Class DirectCaptureCustomOutput

Namespace
VisioForge.Core.Types.Output
Assembly
VisioForge.Core.dll

DirectCapture custom output configuration for capturing video and audio using custom DirectShow filters and muxers.

public sealed class DirectCaptureCustomOutput : IVideoCaptureBaseOutput

Inheritance

Implements

Inherited Members

Examples

// Example: Configure custom output with x264vfw video codec and AC3 audio
var customOutput = new DirectCaptureCustomOutput
{
    Video_Codec = "x264vfw - H.264/MPEG-4 AVC codec",
    Audio_Codec = "AC3Filter",
    MuxFilter_Name = "Haali Matroska Muxer",
    Audio_SampleRate = 48000,
    Audio_Channels = 6, // 5.1 surround
    Audio_BPS = 16
};

Remarks

This class allows advanced users to configure custom output formats by specifying their own DirectShow filters for video compression, audio compression, and multiplexing. This is useful when working with specialized codecs or proprietary formats that aren't covered by the standard output options.

DirectCapture technology enables capturing without re-encoding when possible, preserving the original quality and reducing CPU usage. This custom output mode extends that capability to user-defined filter combinations.

Common use cases include: - Using third-party codec filters (e.g., specialized H.264/H.265 encoders) - Implementing custom container formats - Integrating with proprietary broadcasting systems - Creating specialized archival formats

Constructors

DirectCaptureCustomOutput()

Initializes a new instance of the VisioForge.Core.Types.Output.DirectCaptureCustomOutput class with default settings.

public DirectCaptureCustomOutput()

Remarks

Default configuration:

  • Video codec: "MJPEG Compressor"
  • Audio codec: "PCM" (uncompressed)
  • Multiplexer: "AVI Mux"
  • Audio: 16-bit stereo at 44100 Hz
  • Codec categories: Standard (not DirectShow Filters)

These defaults create a basic AVI output using DirectCapture mode. Modify properties to use custom codecs and muxers as needed.

Properties

Audio_BPS

Gets or sets the bits per sample (bit depth) for the audio codec.

public int Audio_BPS { get; set; }

Property Value

int

Remarks

The bits per sample determines the dynamic range and quality of the audio:

  • 8-bit: Lower quality (48 dB dynamic range)
  • 16-bit: CD quality (96 dB dynamic range)
  • 24-bit: Professional quality (144 dB dynamic range)
  • 32-bit: Highest quality for processing

Some codecs may ignore this parameter or force a specific bit depth based on their specifications.

Audio_Channels

Gets or sets the number of audio channels for the audio codec.

public int Audio_Channels { get; set; }

Property Value

int

Remarks

Channel configurations:

  • 1: Mono
  • 2: Stereo
  • 6: 5.1 surround (if supported)
  • 8: 7.1 surround (if supported)

Ensure the selected audio codec supports the specified channel configuration.

Audio_Codec

Gets or sets the name of the DirectShow audio codec filter to use for compression.

public string Audio_Codec { get; set; }

Property Value

string

Remarks

This should be the exact display name of the audio codec filter as it appears in the system. Common values include "PCM" (uncompressed), "LAME Audio Encoder", "AC3Filter", etc. Use DeviceEnumerator to list available audio codecs on the system.

Audio_Codec_UseFiltersCategory

Gets or sets a value indicating whether to search for the audio codec in the "DirectShow Filters" category.

public bool Audio_Codec_UseFiltersCategory { get; set; }

Property Value

bool

Remarks

When true, the system will look for the audio codec in the DirectShow Filters category instead of the Audio Compressors category. This is useful for filters that register themselves differently. Default is false.

Audio_SampleRate

Gets or sets the audio sample rate in Hz (samples per second).

public int Audio_SampleRate { get; set; }

Property Value

int

Remarks

Common sample rates: 8000 (telephone), 11025 (low), 22050 (radio), 44100 (CD), 48000 (professional), 96000 (hi-res), 192000 (ultra hi-res).

MuxFilter_IsEncoder

Gets or sets a value indicating whether the mux filter also performs encoding.

public bool MuxFilter_IsEncoder { get; set; }

Property Value

bool

Remarks

Some filters act as both encoder and muxer (e.g., Windows Media Format SDK filters). Set this to true if your mux filter expects uncompressed input and performs its own compression. Default is false.

MuxFilter_Name

Gets or sets the name of the DirectShow multiplexer filter to use for creating the output container.

public string MuxFilter_Name { get; set; }

Property Value

string

Remarks

This should be the exact display name of the muxer filter. Common values include: "AVI Mux" (for AVI files), "Haali Matroska Muxer" (for MKV files), "GDCL MPEG-4 Multiplexor" (for MP4 files), etc.

SpecialFileWriter_FilterName

Gets or sets the name of a special file writer filter to use instead of the default.

public string SpecialFileWriter_FilterName { get; set; }

Property Value

string

Remarks

Some muxers require specific file writer filters for proper operation. Leave empty to use the default File Writer filter. Only set this if your muxer has specific requirements.

SpecialFileWriter_Needed

Gets or sets a value indicating whether to use a special file writer filter instead of the default.

public bool SpecialFileWriter_Needed { get; set; }

Property Value

bool

Remarks

Set to true if your muxer requires a specific file writer filter (specified in SpecialFileWriter_FilterName). Most standard muxers work with the default file writer, so this is typically false.

Video_Codec

Gets or sets the name of the DirectShow video codec filter to use for compression.

public string Video_Codec { get; set; }

Property Value

string

Remarks

This should be the exact display name of the video codec filter as it appears in the system. Common values include "MJPEG Compressor", "x264vfw - H.264/MPEG-4 AVC codec", "Microsoft MPEG-4 Video Codec V3", etc. Use DeviceEnumerator to list available video codecs.

Video_Codec_UseFiltersCategory

Gets or sets a value indicating whether to search for the video codec in the "DirectShow Filters" category.

public bool Video_Codec_UseFiltersCategory { get; set; }

Property Value

bool

Remarks

When true, the system will look for the video codec in the DirectShow Filters category instead of the Video Compressors category. This is useful for filters that register themselves differently. Default is false.

Methods

GetInternalTypeVC()

Gets the internal output format identifier for video capture operations.

public VideoCaptureOutputFormat GetInternalTypeVC()

Returns

VideoCaptureOutputFormat

Returns VisioForge.Core.Types.VideoCapture.VideoCaptureOutputFormat.Custom to indicate this is a custom DirectCapture output format.

Remarks

This method is used internally by the video capture system to identify the output format type.

GetInternalTypeVE()

Gets the internal output format identifier for video editing operations.

public VideoEditOutputFormat GetInternalTypeVE()

Returns

VideoEditOutputFormat

Returns VisioForge.Core.Types.VideoEdit.VideoEditOutputFormat.Custom to indicate this is a custom output format.

Remarks

This method is used internally by the video editing system to identify the output format type.

Load(string)

Deserializes DirectCapture custom output settings from a JSON string.

public static DirectCaptureCustomOutput Load(string json)

Parameters

json string

The JSON string containing the serialized settings.

Returns

DirectCaptureCustomOutput

A new VisioForge.Core.Types.Output.DirectCaptureCustomOutput instance with settings restored from JSON.

Exceptions

JsonException

Thrown when the JSON string is invalid or cannot be deserialized.

Save()

Serializes the current DirectCapture custom output settings to a JSON string.

public string Save()

Returns

string

A JSON string representation of all configuration settings.

Remarks

The serialized settings can be restored later using the VisioForge.Core.Types.Output.DirectCaptureCustomOutput.Load(System.String) method.