camera_start_video()

Start encoding 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 c 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:

libcamapi

Description:

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 encoded 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.

The Camera library does not automatically play audible shutter sounds when a picture is taken or a video is recorded. Camera applications must supply their own sound when a photo is captured or a video recording begins and ends. While you can choose to not have a shutter sound when taking a picture — you are responsible to ensure that the application adheres to the local laws of the regions in which you wish to distribute the application. For example, it is illegal to mute or modify the shutter sound of a camera application in Japan and Korea. Ensure you comply with the laws and regulations for the countries in which you distribute your application.

Returns:

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