IVideoWriter Interface#
Syntax#
C#
VB
The IVideoWriter type exposes the following members.
Properties#
Name | Description | |
---|---|---|
IsOpen | Returns the open state of the video file. |
Methods#
Name | Description | |
---|---|---|
CanWriteWithoutConversion(IImage) | Checks whether the given image can be added to the video file without prior conversion. | |
CanWriteWithoutConversion(PixelType, Int32, Int32, Int32, ImageOrientation) | Checks whether the given data/image can be added to the video file without prior conversion. | |
Close | Closes the file. | |
Create(String, Double, ICamera) | Creates and opens a file for video writing. | |
Create(String, Double, PixelType, Int32, Int32) | Creates and opens a file for video writing. | |
Write(IImage) | Adds the image to the video. Converts the image to the correct format if required. | |
Write(T)(T[], PixelType, Int32, Int32, Int32, ImageOrientation) | Adds the image to the video. Converts the image to the correct format if required. |
IVideoWriter.CanWriteWithoutConversion Method (IImage)#
Checks whether the given image can be added to the video file without prior conversion.
Syntax#
C#
VB
Parameters#
- image
- Type: Basler.Pylon.IImage
The image to be checked.
Return Value#
Type: Boolean
Returns true if the image can be added to the video stream without prior conversion. Returns false if the image would be automatically converted when Write() is called. Returns false if the image cannot be added at all. See the preconditions of Write() for more information.
Remarks#
IVideoWriter.CanWriteWithoutConversion Method (PixelType, Int32, Int32, Int32, ImageOrientation)#
Checks whether the given data/image can be added to the video file without prior conversion.
Syntax#
C#
bool CanWriteWithoutConversion(
PixelType pixelType,
int width,
int height,
int paddingX,
ImageOrientation orientation
)
VB
Function CanWriteWithoutConversion (
pixelType As PixelType,
width As Integer,
height As Integer,
paddingX As Integer,
orientation As ImageOrientation
) As Boolean
Parameters#
- pixelType
- Type: Basler.Pylon.PixelType
The pixel type of the image. - width
- Type: System.Int32
Width of the image. - height
- Type: System.Int32
Height of the image. - paddingX
- Type: System.Int32
The number of extra data bytes at the end of each row. - orientation
- Type: Basler.Pylon.ImageOrientation
Orientation of the image.
Return Value#
Type: Boolean
Returns true if the image can be added to the video stream without prior conversion. Returns false if the image would be automatically converted when Write() is called. Returns false if the image cannot be added at all. See the preconditions of Write() for more information.
Remarks#
Thread Safety: This method is thread-safe.
IVideoWriter.Close Method#
Closes the file.
Syntax#
C#
VB
Remarks#
Thread Safety: This method is thread-safe.
Error Safety: Does not throw exceptions.
IVideoWriter.Create Method (String, Double, ICamera)#
Creates and opens a file for video writing.
Syntax#
C#
VB
Parameters#
- filename
- Type: System.String
File name of the video file to be created. Existing files will be overwritten. - playbackFramesPerSecond
- Type: System.Double
Playback speed in frames per second. - camera
- Type: Basler.Pylon.ICamera
The camera from which the current settings are read.
Remarks#
This overload reads the PixelType, Width, and Height parameters from the camera passed. Default compression options appropriate for the format will be chosen.
Preconditions:
- The file is writable.
- The camera must be open.
- Depending on the video format used, not all pixel types may be supported.
Error Safety: Can throw exceptions if the file cannot be created successfully or the preconditions are not met.
IVideoWriter.Create Method (String, Double, PixelType, Int32, Int32)#
Creates and opens a file for video writing.
Syntax#
C#
void Create(
string filename,
double playbackFramesPerSecond,
PixelType pixelType,
int width,
int height
)
VB
Sub Create (
filename As String,
playbackFramesPerSecond As Double,
pixelType As PixelType,
width As Integer,
height As Integer
)
Parameters#
- filename
- Type: System.String
File name of the video file to be created. Existing files will be overwritten. - playbackFramesPerSecond
- Type: System.Double
Playback speed in frames per second. - pixelType
- Type: Basler.Pylon.PixelType
The pixel type of the images that will be added to the video writer. This input is used to derive the video format. - width
- Type: System.Int32
Width of the video. - height
- Type: System.Int32
Height of the video.
Remarks#
Default compression options appropriate for the format will be used.
Preconditions:
- The file is writable.
- Depending on the video format used, not all pixel types may be supported.
width
andheight
must be greater than 0.
Error Safety: Can throw exceptions if the file cannot be created successfully or the preconditions are not met.
IVideoWriter.Write Method (IImage)#
Adds the image to the video. Converts the image to the correct format if required.
Syntax#
C#
VB
Parameters#
- image
- Type: Basler.Pylon.IImage
The image to be added.
Remarks#
If required, the image is automatically converted to the target format.
Preconditions
- Create() has been called successfully.
- The image passed is valid.
- The pixel type of the image to add is a format supported by pylon.
- The
width
andheight
of the image match the values passed when opening the video file.
Error Safety: Throws an exception if the image cannot be added.
IVideoWriter.Write(T) Method (T[], PixelType, Int32, Int32, Int32, ImageOrientation)#
Adds the image to the video. Converts the image to the correct format if required.
Syntax#
C#
void Write<T>(
T[] pixelData,
PixelType pixelType,
int width,
int height,
int paddingX,
ImageOrientation orientation
)
VB
Sub Write(Of T) (
pixelData As T(),
pixelType As PixelType,
width As Integer,
height As Integer,
paddingX As Integer,
orientation As ImageOrientation
)
Parameters#
- pixelData
- Type: T[]
The data of the image to be added. - pixelType
- Type: Basler.Pylon.PixelType
The pixel type of the image. - width
- Type: System.Int32
Width of the image. - height
- Type: System.Int32
Height of the image. - paddingX
- Type: System.Int32
The number of extra data bytes at the end of each row. - orientation
- Type: Basler.Pylon.ImageOrientation
Orientation of the video. Most codecs support ImageOrientation.BottomUp only.
Type Parameters#
- T
- The data type of pixels stored in
pixelData
.
Remarks#
If required, the image is automatically converted to the target format.
Preconditions
- Create() has been called successfully.
- The image passed is valid.
- The pixel type of the image to add is a format supported by pylon.
- The
width
andheight
of the image match the values passed when opening the video file.
Error Safety: Throws an exception if the image cannot be added.
IVideoWriter.CanWriteWithoutConversion Method#
Overload List#
Name | Description | |
---|---|---|
CanWriteWithoutConversion(IImage) | Checks whether the given image can be added to the video file without prior conversion. | |
CanWriteWithoutConversion(PixelType, Int32, Int32, Int32, ImageOrientation) | Checks whether the given data/image can be added to the video file without prior conversion. |
IVideoWriter.Create Method#
Overload List#
Name | Description | |
---|---|---|
Create(String, Double, ICamera) | Creates and opens a file for video writing. | |
Create(String, Double, PixelType, Int32, Int32) | Creates and opens a file for video writing. |
IVideoWriter.Write Method#
Overload List#
Name | Description | |
---|---|---|
Write(IImage) | Adds the image to the video. Converts the image to the correct format if required. | |
Write(T)(T[], PixelType, Int32, Int32, Int32, ImageOrientation) | Adds the image to the video. Converts the image to the correct format if required. |
IVideoWriter.IsOpen Property#
Returns the open state of the video file.
Syntax#
C#
VB
Return Value#
Type: Boolean
Returns true if a file for video output has been opened.
Remarks#
Thread Safety: This method is thread-safe.
Error Safety: Does not throw exceptions.