camera_start_video()
Start recording video.
Synopsis:
#include <camera/camera_api.h>
camera_error_t camera_start_video(camera_handle_t handle, const char *filename, void(*video_callback)(camera_handle_t, camera_buffer_t *, void *), void(*status_callback)(camera_handle_t, camera_devstatus_t, uint16_t, void *), void *arg)
Arguments:
- handle
-
The handle returned by a call to the camera_open() function.
- filename
-
The name of the file to save the video to.
- video_callback
-
A function pointer to a function with the following signature: void function_name( camera_handle_t, camera_buffer_t*, void*). The function is a callback function to invoke when the uncompressed video frame is available. You can use NULL if no function needs to be called. For information about the callback arguments, see About callback mode.
- status_callback
-
A function pointer to a function with the following signature: void function_name(camera_handle_t, camera_devstatus_t, uint16_t, void*). The function is a callback that gets invoked when status events occur. You can use NULL if no function needs to be called. For information about the callback arguments, see About callback mode.
- arg
-
The argument passed to all callback functions, which is the last argument in the callback functions.
Library:
libcamapiDescription:
This function can only be called if the CAMERA_FEATURE_VIDEO is available. You can determine whether the feature is available by calling the camera_can_feature() function.
Video is recorded based on the configured properties. You must use the camera_start_video_viewfinder() to start the viewfinder before you call this function. The audio track will be taken from the active audio input on the device.
Note: Before calling this function, call the camera_set_video_property() function to ensure that all required properties are set.
Returns:
CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed. CAMERA_EINVAL is returned if there is a mismatch in video properties set using camera_set_video_property() function.