Synchronized Recording

You can start all cameras configured on your system to start recording at the same time. The Camera Framework provides the capability for you to start recording from multiple cameras and ensures that the timestamps on the encoded video match.

Here are some situations when synchronized recording is important to ensure that there isn't any latency between the video from multiple cameras.
To start multiple cameras at one time, you must first associate the cameras in your system into a video group. After you have opened (you require the handles to each camera) and set the viewfinder mode on your cameras, you would perform the following steps:
  1. Create a video group using the camera_create_video_group.. You will get a group ID passed by reference back to you from the call.
  2. Call camera_add_video_group_entry() to associate (or add) each camera to the video group. You specify the the group ID and the handle for each camera when you call camera_add_video_group_entry(). You can add or remove cameras before you call camera_start_video_group() or camera_start_video() on the camera.
  3. If you want to encode or record video, you must call camera_start_encode() or camera_start_video(), respectively.
    Note: This step doesn't actually start the encoding or recording until the next step.
  4. To start synchronized recording on all cameras, call camera_start_video_group() to start encoding or recording at the same time.

    To stop recording, you can call camera_stop_video_group(), but then you must call camera_stop_encode() or camera_stop_video() to finalize encoding or the video files for each camera. You can remove cameras from the video group after to you stop recording.

  5. After you are done using the video group, call camera_destroy_video_group(). Any cameras still associated with the video group are automatically disassociated from the group before the function completes. It's a good idea to set the group ID variable to CAMERA_VIDEO_GROUP_INVALID after camera_destroy_video_group() completes.
`