camera_set_video_property()

Configure the output properties for video recording and encoding

Synopsis:

#include <camera/camera_api.h>
#define camera_set_video_property(handle,
                                  args...)

Arguments:

handle
The handle returned by a call to the camera_open() function.
args
A series of comma-delimited property-value pairs where each value must be a pointer to a variable of the expected type.

Library:

libcamapi

Description:

This function configures the output properties for video recording and encoding. Ensure that you call this function before you start video recording or encoding.

For the args argument, you can provide one or more property-value pairs using camera_imgprop_t for the property and int or double for the value. The function can use the following properties:

Note:

The compiler performs no type-checking. Therefore, the value you provide for each property must match the expected data type. Mismatches can cause undefined behavior and application crashes.

You can specify multiple property-value pairs by delimiting them with a comma as follows:
camera_set_video_property( camera_handle,
                           CAMERA_IMGPROP_VIDEOCODEC, CAMERA_VIDEOCODEC_AVC1,
                           CAMERA_IMGPROP_FRAMERATE, (double)30.0 );
You can set CAMERA_IMGPROP_ENCODERSELECT with or without permissions:
  • When set to CAMERA_ENCODER_LOCAL, the library uses a local encoder, and write permissions on the camera are not required.
  • When set to CAMERA_ENCODER_REMOTE, the library uses the encoder inside the camera, which requires write permissions enabled. When calling the camera_open() function, set the mode parameter to CAMERA_MODE_RW. For more information, go to the Camera access mode flags section.

To set write permissions for the viewfinder properties when you call the camera_open() function, use a pertinent camera access mode flag: CAMERA_MODE_RW (read-and-write) or CAMERA_MODE_RO (read-only), depending on the property.

Note:

The viewfinder frame rate, which is used for the CAMERA_IMGPROP_FRAMERATE property in the camera_set_vf_property() call, must be an integer multiple of the video frame rate used in this function.

Returns:

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason why the call failed.

Page updated: