Class AVIOutput
- Namespace
- VisioForge.Core.Types.Output
- Assembly
- VisioForge.Core.dll
Represents configuration settings for Audio Video Interleave (AVI) file output.
public sealed class AVIOutput : IVideoCaptureBaseOutput, IVideoEditBaseOutputInheritance
Implements
Inherited Members
Remarks
AVI is a multimedia container format introduced by Microsoft as part of its Video for Windows technology. This class provides comprehensive settings for creating AVI files with various video codecs, audio formats, and interleaving options. AVI files support multiple audio and video streams and are widely compatible with media players, though they have limitations with modern codecs and features compared to newer formats.
The class supports both compressed and uncompressed video, ACM (Audio Compression Manager) audio codecs, and optional MP3 audio encoding through LAME. It implements both video capture and video editing interfaces, making it suitable for real-time recording and post-processing scenarios.
Constructors
AVIOutput()
Initializes a new instance of the VisioForge.Core.Types.Output.AVIOutput class with default settings.
public AVIOutput()Remarks
Default configuration:
- Video compression: Enabled with MJPEG codec
- Video format: RGB with decompression enabled
- Audio: PCM 16-bit stereo at 44100 Hz
- AVI 1.0 compatibility: Disabled (supports files > 2GB)
- Interleaving: Default mode
This provides a good balance of quality and compatibility for most AVI recording scenarios.
AVIOutput(MP3Output)
Initializes a new instance of the VisioForge.Core.Types.Output.AVIOutput class configured for MP3 audio encoding.
public AVIOutput(MP3Output lame)Parameters
lameMP3Output-
The MP3 output settings to use for audio encoding.
Remarks
This constructor creates an AVI output configuration that uses LAME MP3 encoding for audio.
The VisioForge.Core.Types.Output.AVIOutput.Audio_UseMP3Encoder property is automatically set to true.
Video settings should be configured separately through the appropriate properties.
Properties
ACM
Gets or sets the ACM (Audio Compression Manager) audio codec settings.
public ACMOutput ACM { get; set; }Property Value
Remarks
This property is used when VisioForge.Core.Types.Output.AVIOutput.Audio_UseMP3Encoder is set to false.
It controls the audio codec, sample rate, bit depth, and channels through the Windows
Audio Compression Manager interface, providing access to various installed audio codecs.
Audio_UseMP3Encoder
Gets or sets a value indicating whether the LAME MP3 encoder should be used for audio compression.
public bool Audio_UseMP3Encoder { get; set; }Property Value
Remarks
When enabled, audio will be compressed using the LAME MP3 encoder with settings specified in the VisioForge.Core.Types.Output.AVIOutput.MP3 property. When disabled, audio will use the ACM codec specified in VisioForge.Core.Types.Output.AVIOutput.ACM. MP3 audio provides good compression and compatibility but may not be suitable for professional applications requiring lossless or specific audio formats.
MP3
Gets or sets the LAME MP3 encoder settings for audio compression.
public MP3Output MP3 { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.Output.AVIOutput.Audio_UseMP3Encoder is set to true.
When MP3 encoding is enabled, the settings in this property determine the bitrate,
quality, and other MP3-specific parameters for audio compression using the LAME encoder.
Video_AVI_10Compatibility
Gets or sets a value indicating whether AVI 1.0 compatibility mode should be enabled.
public bool Video_AVI_10Compatibility { get; set; }Property Value
Remarks
AVI 1.0 compatibility mode ensures the file can be played on older systems and software that don't support AVI 2.0 features. However, it imposes a 2GB file size limit and restricts some modern features. Enable this only when targeting legacy systems. AVI 2.0 (OpenDML) supports files larger than 2GB and additional features but may not work with very old media players.
Video_AVI_Interleaving
Gets or sets the interleaving mode for multiplexing audio and video streams in the AVI file.
public AVIInterleaving Video_AVI_Interleaving { get; set; }Property Value
Remarks
Interleaving affects how audio and video data are arranged in the file, impacting both file creation performance and playback smoothness. For real-time capture, VisioForge.Core.Types.Output.AVIInterleaving.Capture provides a good balance. For final output files, VisioForge.Core.Types.Output.AVIInterleaving.Full ensures the best playback experience. See VisioForge.Core.Types.Output.AVIInterleaving for detailed information about each mode.
Video_Codec
Gets or sets the name of the video codec to use for compression.
public string Video_Codec { get; set; }Property Value
Remarks
Common video codecs for AVI include:
- "MJPEG Compressor": Motion JPEG, good quality and compatibility
- "Microsoft Video 1": Legacy codec, very compatible but low quality
- "Cinepak Codec by Radius": Legacy codec for older systems
- "DV Video Encoder": Digital Video format, used by camcorders
- "Uncompressed": Raw video, highest quality but very large files
- Various FourCC codes: "XVID", "DIVX", "H264" (if codecs installed)
The available codecs depend on what VFW (Video for Windows) codecs are installed on the system. Use uncompressed when quality is critical and file size is not a concern.
Video_UseCompression
Gets or sets a value indicating whether video compression should be applied.
public bool Video_UseCompression { get; set; }Property Value
Remarks
When enabled, video will be compressed using the codec specified in VisioForge.Core.Types.Output.AVIOutput.Video_Codec. When disabled, video will be stored as uncompressed RGB or YUV data, resulting in very large files but maintaining perfect quality. Uncompressed video is typically used for:
- Professional editing where quality loss is unacceptable
- Intermediate files in production workflows
- Archival purposes where storage space is not a concern
Note that uncompressed HD video can easily exceed 100 MB/s data rate.
Video_UseCompression_DecodeUncompressedToRGB
Gets or sets a value indicating whether raw video from the camera should be decoded to uncompressed RGB format before compression.
public bool Video_UseCompression_DecodeUncompressedToRGB { get; set; }Property Value
Remarks
Many cameras output video in compressed formats (like MJPEG) or YUV color spaces. When this property is enabled, the video is first decoded to uncompressed RGB before being re-encoded with the selected codec. This ensures maximum compatibility but may result in quality loss due to recompression.
Disable this when:
- The camera's native format is already compatible with your needs
- You want to avoid recompression artifacts
- Performance is critical and unnecessary conversions should be avoided
Enable this when:
- Maximum compatibility with video codecs is required
- Color space conversions are needed
- Post-processing effects require RGB input
Methods
GetInternalTypeVC()
Gets the internal output format identifier for video capture operations.
public VideoCaptureOutputFormat GetInternalTypeVC()Returns
- VideoCaptureOutputFormat
-
Returns VisioForge.Core.Types.VideoCapture.VideoCaptureOutputFormat.AVI to indicate this is an AVI output format.
Remarks
This method is used internally by the video capture system to identify the output format type. It implements the VisioForge.Core.Types.Output.IVideoCaptureBaseOutput.GetInternalTypeVC interface method.
GetInternalTypeVE()
Gets the internal output format identifier for video editing operations.
public VideoEditOutputFormat GetInternalTypeVE()Returns
- VideoEditOutputFormat
-
Returns VisioForge.Core.Types.VideoEdit.VideoEditOutputFormat.AVI to indicate this is an AVI output format.
Remarks
This method is used internally by the video editing system to identify the output format type. It implements the VisioForge.Core.Types.Output.IVideoEditBaseOutput.GetInternalTypeVE interface method.
Load(string)
Deserializes AVI output settings from a JSON string.
public static AVIOutput Load(string json)Parameters
jsonstring-
The JSON string containing the serialized AVI output settings.
Returns
- AVIOutput
-
A new VisioForge.Core.Types.Output.AVIOutput instance with settings restored from the JSON string.
Remarks
This method uses the default JSON deserialization options from VisioForge.Core.Helpers.JsonSerializerOptionsHelper. The JSON string should have been created using the VisioForge.Core.Types.Output.AVIOutput.Save method or follow the same format. All properties including nested objects (MP3 and ACM settings) will be restored.
Exceptions
- JsonException
-
Thrown when the JSON string is invalid or cannot be deserialized to an AVIOutput object.
Save()
Serializes the current AVI output settings to a JSON string.
public string Save()Returns
- string
-
A JSON string representation of the current settings that can be persisted or transmitted.
Remarks
This method uses the default JSON serialization options from VisioForge.Core.Helpers.JsonSerializerOptionsHelper. The resulting JSON includes all configuration properties such as codec settings, compression options, and audio parameters. The serialized settings can be restored later using the VisioForge.Core.Types.Output.AVIOutput.Load(System.String) method.