camCaptureStart (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400

Firmware version:

1.12.00


This function begins recording video from a camera.

The video is either saved as a raw MJPEG stream, or as MJPEG inside e.g. an MKV container.

When recording to the internal drive, care must be taken not to fill it up, as it will affect the performance.

 

 

Input:

width : INT

The wanted width of the video. The actual width used may be smaller, depending on the camera.

 

height : INT

The wanted height of the video. The actual height used may be smaller, depending on the camera.

 

filename : STRING

The name of the file to store the recoding in. It is overwritten if it already exists.

 

duration : DINT

The number of seconds to keep recording for. If set to 0, the recoding continues until it runs out of space or it is stopped using camCaptureStop.

 

format : INT default 2

The file format to use when saving the file:

Format

Name

Decription

0

MJPEG

Raw MJPEG stream directly from the camera.

2

MKV

Matroska container containing the MJPEG data.

 

 

Returns: INT

 

0

- The recording was started. Use camCaptureStatus to check the status of the recording.

-1

- Failed (camera removed, communication problem, camera does not support MJPEG format(see camGetInfo)).

-3

- Invalid parameter

-4

- Camera is already recording.

-5

- Camera interface not open.

-6

- Failed to create the file.

-7

- Invalid format provided.

 

Declaration:

FUNCTION camCaptureStart : INT;
VAR_INPUT
  width   : INT;
  height   : INT;
  filename : STRING;
  duration : DINT;
  format   : INT := 2;
END_VAR;

 

 

Example:

// Record 720p video for 10 seconds to the file A:\REC.MKV
camCaptureStart(width:=1280, height := 720, filename := "A:\REC.MKV", duration:=10, format:=2);