LiveView

The LiveView feature enables seeing the camera’s sensor output in almost real-time. This output is scaled and converted into RGB (Debayered) automatically by the camera.

LiveView is received as a series of still 24-bit RGB bitmap images, like frames in a movie. The newest frame will be provided to the user, and any older frames are discarded. this means you always access the newest frame (if any), and never receive a frame that is older, than the one you got previously. To receive the frames, you must enable LiveView in the CameraSDK, as follows:

camera.EnableLiveView();
camera.SetLiveViewEnable(true);

This initiates LiveView in the camera, and the camera will begin to stream frames to the CameraSDK. Tap into this stream by using the WaitForLiveView method, as follows:

P1::CameraSdk::LiveViewImage liveView = camera.WaitForLiveView();
LiveViewImage liveView = camera.WaitForLiveView();

The LiveViewImage contains e.g. the width and height of the LiveView frames, as well as information about the format of the LiveView frames.

The LiveView frames are stored in memory “borrowed” from the CameraSDK. Therefore, you must always dispose the LiveView image object, as soon as possible.

Warning

Failing to dispose will cause the internal LiveView receive buffer to run out of memory, and become unable to pass new LiveView frames.

When LiveView is no longer desired, stop the LiveView feed from the camera. This reduces both the power consumption and heat generation of the camera significantly. Disabling the LiveView feed can be done as follows:

camera.DisableLiveView();
camera.SetLiveViewEnable(false);