• Introduction
  • Programmer's Guide
  • Technical Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • ic4
      • BufferPool
      • DeviceEnum
      • DeviceInfo
      • Display
      • DisplayNotation
      • DisplayRenderPosition
      • DisplayStatistics
      • DisplayType
      • EmbeddedDisplay
      • ErrorCode
      • ExternalOpenGLDisplay
      • FloatRepresentation
      • FloatingDisplay
      • FrameMetaData
      • Grabber
      • HandleObject
      • IBufferAllocator
      • IC4Exception
      • IDisplay
      • ImageBuffer
      • ImageBuffer.CopyOptions
      • ImageBufferExtensions
      • ImageBufferExtensionsOpenCvSharp
      • ImageType
      • IntRepresentation
      • Interface
      • Library
      • LogLevel
      • LogTarget
      • PixelFormat
      • PixelFormatExtensions
      • PngCompressionLevel
      • PropBoolean
      • PropCategory
      • PropCommand
      • PropEnumEntry
      • PropEnumeration
      • PropFloat
      • PropId
      • PropIdBoolean
      • PropIdCommand
      • PropIdEnumeration
      • PropIdFloat
      • PropIdInteger
      • PropIdRegister
      • PropIdString
      • PropInteger
      • PropRegister
      • PropString
      • Property
      • PropertyIncrementMode
      • PropertyMap
      • PropertyType
      • PropertyVisibility
      • QueueSink
      • QueueSinkConnectedEventArgs
      • QueueSinkEventArgs
      • QueueSinkQueueSizes
      • Sink
      • SinkMode
      • SinkType
      • SnapSink
      • SnapSinkAllocationStrategy
      • StreamSetupOption
      • StreamStatistics
      • TransportLayerType
      • VersionInfoFlags
      • VideoWriter
      • VideoWriterType

    Class VideoWriter

    Represents a video writer

    Inheritance
    object
    HandleObject
    VideoWriter
    Implements
    IDisposable
    Inherited Members
    HandleObject.Dispose(bool)
    HandleObject.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ic4
    Assembly: ic4dotnet.dll
    Syntax
    public class VideoWriter : HandleObject, IDisposable
    Remarks

    To create a video writer, use the VideoWriter(VideoWriterType) constructor, passing the type of the desired video file.

    After creating the video writer, call BeginFile(string, ImageType, double) to start writing a new video file. Call AddFrame(ImageBuffer) to add images to the video file. To complete the recording, call FinishFile().

    Use PropertyMap to access encoder configuration options.

    Constructors

    VideoWriter(VideoWriterType)

    Creates a new video writer.

    Declaration
    public VideoWriter(VideoWriterType type)
    Parameters
    Type Name Description
    VideoWriterType type

    The type of video file to create a writer for

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Properties

    PropertyMap

    The video writer's property map for encoder configuration

    Declaration
    public PropertyMap PropertyMap { get; }
    Property Value
    Type Description
    PropertyMap

    The video writer's property map

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Methods

    AddFrame(ImageBuffer)

    Adds an image to the currently open video file.

    Declaration
    public void AddFrame(ImageBuffer buffer)
    Parameters
    Type Name Description
    ImageBuffer buffer

    Image buffer to be added to the video file

    Remarks

    BeginFile(string, ImageType, double) must be called before adding images to the video file.

    The image buffer's ImageType must be equal to the imageType parameter passed to BeginFile(string, ImageType, double) when starting the file.

    The video writer can retain a reference to the image buffer. This can delay the release and possible reuse of the image buffer. In this case, the buffer becomes shared, and is no longer safely writable (IsWritable). Use AddFrameCopy(ImageBuffer) to always let the video writer immediately copy the data out of the image buffer.

    Exceptions
    Type Condition
    ArgumentNullException

    buffer is null.

    InvalidOperationException

    BeginFile(string, ImageType, double) was not called.

    IC4Exception

    Check ErrorCode and ToString() for details.

    AddFrameCopy(ImageBuffer)

    Adds an image to the currently open video file, copying the image data in the process.

    Declaration
    public void AddFrameCopy(ImageBuffer buffer)
    Parameters
    Type Name Description
    ImageBuffer buffer

    Image buffer to be added to the video file

    Remarks

    BeginFile(string, ImageType, double) must be called before adding images to the video file.

    The image buffer's ImageType must be equal to the imageType parameter passed to BeginFile(string, ImageType, double) when starting the file.

    The image buffer's contents will be copied, so that the buffer's reference count is not increased and it can be reused immedietely if the final reference is released. Use AddFrame(ImageBuffer) to avoid the copy operation if it is not necessary.

    Exceptions
    Type Condition
    ArgumentNullException

    buffer is null.

    InvalidOperationException

    BeginFile(string, ImageType, double) was not called.

    IC4Exception

    Check ErrorCode and ToString() for details.

    BeginFile(string, ImageType, double)

    Opens a new video file ready to write images into.

    Declaration
    public void BeginFile(string fileName, ImageType imageType, double frameRate)
    Parameters
    Type Name Description
    string fileName

    Name of the new video file

    ImageType imageType

    Image type of the images that are going to be written

    double frameRate

    Playback frame rate of the video file

    Exceptions
    Type Condition
    ArgumentNullException
    InvalidOperationException

    BeginFile was already called without a matching call to FinishFile().

    IC4Exception

    Check ErrorCode and ToString() for details.

    FinishFile()

    Finishes writing a video file.

    Declaration
    public void FinishFile()
    Exceptions
    Type Condition
    InvalidOperationException

    BeginFile(string, ImageType, double) was not called.

    IC4Exception

    Check ErrorCode and ToString() for details.

    Implements

    IDisposable
    In this article
    Copyright ©️ 2024 The Imaging Source Europe GmbH www.theimagingsource.com