IDSpeakcomfortC  v1.5.0

Data Structures

struct  peak_video_info
 video info structure More...
 

Typedefs

typedef struct peak_video * peak_video_handle
 peak Video handle More...
 

Enumerations

enum  peak_video_encoder { PEAK_VIDEO_ENCODER_INVALID, PEAK_VIDEO_ENCODER_MJPEG }
 peak Encoder types More...
 
enum  peak_video_container { PEAK_VIDEO_CONTAINER_INVALID, PEAK_VIDEO_CONTAINER_AVI }
 peak Container types More...
 
enum  peak_video_container_option { PEAK_VIDEO_CONTAINER_OPTION_INVALID, PEAK_VIDEO_CONTAINER_OPTION_FRAMERATE }
 peak container options More...
 
enum  peak_video_encoder_option { PEAK_VIDEO_ENCODER_OPTION_INVALID, PEAK_VIDEO_ENCODER_OPTION_QUALITY }
 peak container options More...
 

Functions

peak_status peak_VideoWriter_Open (peak_video_handle *hVideo, const char *fileName, peak_video_container container, peak_video_encoder encoder)
 Opens a video file with the given file name. More...
 
peak_status peak_VideoWriter_Close (peak_video_handle hVideo)
 Closes a video file. More...
 
peak_status peak_VideoWriter_AddFrame (peak_video_handle hVideo, peak_frame_handle hFrame)
 Writes a image frame into the video file. More...
 
peak_status peak_VideoWriter_Container_GetEncoderList (peak_video_container container, peak_video_encoder *encoderList, size_t *encoderCount)
 Get the list of currently usable encoders. More...
 
peak_status peak_VideoWriter_Encoder_GetContainerList (peak_video_encoder encoder, peak_video_container *containerList, size_t *containerCount)
 Get the list of currently usable containers. More...
 
peak_status peak_VideoWriter_GetInfo (peak_video_handle hVideo, peak_video_info *videoInfo)
 Get information from the video stream. More...
 
peak_status peak_VideoWriter_Container_Option_Set (peak_video_handle hVideo, peak_video_container_option containerOption, const void *value, size_t count)
 Set additional container options. More...
 
peak_status peak_VideoWriter_Container_Option_Get (peak_video_handle hVideo, peak_video_container_option containerOption, void *value, size_t count, size_t *outCount)
 Get container options. More...
 
peak_status peak_VideoWriter_Encoder_Option_Set (peak_video_handle hVideo, peak_video_encoder_option encoderOption, const void *value, size_t count)
 Set additional encoder options. More...
 
peak_status peak_VideoWriter_Encoder_Option_Get (peak_video_handle hVideo, peak_video_encoder_option encoderOption, void *value, size_t count, size_t *outCount)
 Get encoder options. More...
 
peak_status peak_VideoWriter_WaitUntilQueueEmpty (peak_video_handle hVideo, int32_t timeout_ms)
 Wait until queue is empty. More...
 

Detailed Description

Functions for saving images as video file.

Typedef Documentation

◆ peak_video_handle

typedef struct peak_video* peak_video_handle

peak Video handle

The video handle repesents an opened video handle.
The video handle is provided by the peak_VideoWriter_Open function and must be released by peak_VideoWriter_Close.
The video handle is required in every function which controls a video stream.

The value for an invalid camera handle is PEAK_INVALID_HANDLE.

Enumeration Type Documentation

◆ peak_video_container

peak Container types

The container specifies the used file format for saving the video.

Enumerator
PEAK_VIDEO_CONTAINER_INVALID 

Invalid container.

Use this value for the initialization of variables of type peak_video_container.

PEAK_VIDEO_CONTAINER_AVI 

Audio Video Interleave.

◆ peak_video_container_option

peak container options

The container can be configured via the given options.

Enumerator
PEAK_VIDEO_CONTAINER_OPTION_INVALID 

Invalid container option.

Use this value for the initialization of variables of type peak_video_container_option.

PEAK_VIDEO_CONTAINER_OPTION_FRAMERATE 

Framerate container option.

Use this option to set or retrieve the frame rate of the avi container. Given value must be an double.

◆ peak_video_encoder

peak Encoder types

The encoder specifies the used video compression.

Enumerator
PEAK_VIDEO_ENCODER_INVALID 

Invalid encoder.

Use this value for the initialization of variables of type peak_video_encoder.

PEAK_VIDEO_ENCODER_MJPEG 

Motion JPEG.

◆ peak_video_encoder_option

peak container options

The encoder can be configured via the given options.

Enumerator
PEAK_VIDEO_ENCODER_OPTION_INVALID 

Invalid encoder option.

Use this value for the initialization of variables of type peak_video_encoder_option.

PEAK_VIDEO_ENCODER_OPTION_QUALITY 

Quality encoder option.

Use this option to set or retrieve the quality of the mjpeg encoder. Given value must be an int32_t.

Function Documentation

◆ peak_VideoWriter_AddFrame()

peak_status peak_VideoWriter_AddFrame ( peak_video_handle  hVideo,
peak_frame_handle  hFrame 
)

Writes a image frame into the video file.

Parameters
[in]hVideoThe video handle.
[in]hFrameA frame handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle or hFrame is an invalid frame handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_INVALID_PARAMETER The configured container or encoder are not valid for the given frame.
PEAK_STATUS_BUSY The internal image queue is full.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Close()

peak_status peak_VideoWriter_Close ( peak_video_handle  hVideo)

Closes a video file.

Parameters
[in]hVideoThe video handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
The video handle is no longer valid after the function has returned.

◆ peak_VideoWriter_Container_GetEncoderList()

peak_status peak_VideoWriter_Container_GetEncoderList ( peak_video_container  container,
peak_video_encoder *  encoderList,
size_t *  encoderCount 
)

Get the list of currently usable encoders.

Queries the list of currently selectable encoders for the given container.

This function implements the Two Staged Data Query principle.

Parameters
[in]containerContainer
[out]encoderListPointer to a user allocated array buffer to receive the encoder type list. If this parameter is NULL, encoderCount will contain the current number of encoder types.
The required size of encoderList in bytes is encoderCount x sizeof(peak_video_encoder).
[in,out]encoderCount
  • encoderList equal NULL:
    out: minimal number of encoder types encoderList must be large enough to hold
  • encoderList unequal NULL:
    in: number of encoder types encoderList can hold
    out: number of encoder types filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL encoderList is not NULL and the value of *encoderCount is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER encoder is an invalid container or encoderCount is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Container_Option_Get()

peak_status peak_VideoWriter_Container_Option_Get ( peak_video_handle  hVideo,
peak_video_container_option  containerOption,
void *  value,
size_t  count,
size_t *  outCount 
)

Get container options.

Parameters
[in]hVideoThe video handle.
[in]containerOptionContainer option to retrieve see peak_video_container_option
[out]valuesee peak_video_container_option for possible values
[in]countsize of value in bytes.
[out]outCountsize of written data in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_INVALID_PARAMETER containerOption is an invalid option or value is an invalid pointer or the size of count is incorrect.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Container_Option_Set()

peak_status peak_VideoWriter_Container_Option_Set ( peak_video_handle  hVideo,
peak_video_container_option  containerOption,
const void *  value,
size_t  count 
)

Set additional container options.

Parameters
[in]hVideoThe video handle.
[in]containerOptionContainer option to set see peak_video_container_option
[in]valuesee peak_video_container_option
[in]countsize of value in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_INVALID_PARAMETER containerOption is an invalid option or value is an invalid pointer or the size of count is incorrect.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Encoder_GetContainerList()

peak_status peak_VideoWriter_Encoder_GetContainerList ( peak_video_encoder  encoder,
peak_video_container *  containerList,
size_t *  containerCount 
)

Get the list of currently usable containers.

Queries the list of currently selectable containers.

This function implements the Two Staged Data Query principle.

Parameters
[in]encoderEncoder
[out]containerListPointer to a user allocated array buffer to receive the container type list. If this parameter is NULL, containerCount will contain the current number of container types.
The required size of containerList in bytes is containerCount x sizeof(peak_video_container).
[in,out]containerCount
  • containerList equal NULL:
    out: minimal number of container types containerList must be large enough to hold
  • containerList unequal NULL:
    in: number of container types containerList can hold
    out: number of container types filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL containerList is not NULL and the value of *containerCount is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER encoder is an invalid encoder or containerCount is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Encoder_Option_Get()

peak_status peak_VideoWriter_Encoder_Option_Get ( peak_video_handle  hVideo,
peak_video_encoder_option  encoderOption,
void *  value,
size_t  count,
size_t *  outCount 
)

Get encoder options.

Parameters
[in]hVideoThe video handle.
[in]encoderOptionEncoder option to retrieve see peak_video_encoder_option.
[out]valuesee peak_video_encoder_option.
[in]countsize of value in bytes.
[out]outCountsize of written data in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_INVALID_PARAMETER encoderOption is an invalid option or value is an invalid pointer or the size of count is incorrect.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Encoder_Option_Set()

peak_status peak_VideoWriter_Encoder_Option_Set ( peak_video_handle  hVideo,
peak_video_encoder_option  encoderOption,
const void *  value,
size_t  count 
)

Set additional encoder options.

Parameters
[in]hVideoThe video handle.
[in]encoderOptionEncoder option to set see peak_video_encoder_option
[in]valuesee peak_video_encoder_option for possible values
[in]countsize of value in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_INVALID_PARAMETER encoderOption is an invalid option or value is an invalid pointer or the size of count is incorrect.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_GetInfo()

peak_status peak_VideoWriter_GetInfo ( peak_video_handle  hVideo,
peak_video_info *  videoInfo 
)

Get information from the video stream.

Parameters
[in]hVideoThe video handle.
[out]videoInfoVideo information.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_INVALID_PARAMETER videoInfo is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_Open()

peak_status peak_VideoWriter_Open ( peak_video_handle *  hVideo,
const char *  fileName,
peak_video_container  container,
peak_video_encoder  encoder 
)

Opens a video file with the given file name.

Parameters
[out]hVideoThe video handle.
[in]fileNameThe given file name to use as an utf-8 encoded string
[in]containerThe container of the video.
[in]encoderThe encoder of the video.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER hVideo and/or fileName are invalid pointers.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED A file with the given file name already exists or can not be locked.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_VideoWriter_WaitUntilQueueEmpty()

peak_status peak_VideoWriter_WaitUntilQueueEmpty ( peak_video_handle  hVideo,
int32_t  timeout_ms 
)

Wait until queue is empty.

Parameters
[in]hVideoThe video handle.
[in]timeout_msTimeout in milliseconds
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hVideo is an invalid video handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_TIMEOUT The wait timeout has elapsed.
PEAK_STATUS_ERROR An unexpected internal error occurred.