Synchronization of video cameras
Disclosed are systems and methods for synchronously capturing video using respective cameras of a plurality of devices. The devices capture video according to a schedule based on a common camera period and a common synchronized clock, and adjust their video capture parameters based on departures from the schedule.
1 . A system for capturing video, the system comprising:
a plurality of electronic devices, each of which comprises a respective camera with which the electronic device is configured to capture video; and
at least one server, which is configured to transmit a synchronized clock value to each of the plurality of devices, and to receive video data from each of the plurality of devices,
wherein the system is configured to determine a first camera sync time, including by adding an integral number of camera periods to the synchronized clock value, wherein a camera period is a time interval that substantially corresponds with a respective frame capture interval configured at each of the plurality of electronic devices, the frame capture interval being the time between successive captured frames,
wherein the system is further configured to determine a second camera sync time, including by adding an integral number of camera periods to the first camera sync time,
wherein each of the plurality of devices is configured to:
determine that the first camera sync time has passed, and, in response, determine a first camera offset by calculating a difference between a timestamp time for a current frame captured by the device, and the first camera sync time; and
calculate an adjustment to adjust one or more video capture parameters of the device based on said first camera offset, so that a second camera offset, which is a difference between a timestamp time for a subsequent frame captured by the device and the second camera sync time, is smaller than the first camera offset.
2 . The system of claim 1 , wherein each of the plurality of devices is configured to:
compare said first camera offset with a threshold; and
adjust said one or more video capture parameters of the device based on an amount by which the first camera offset exceeds said threshold.
3 . The system of claim 1 , wherein the system is further configured to:
determine one or more additional camera sync times, including by, for each of the one or more additional camera sync times, adding said integral number of camera periods to an immediately preceding camera sync time,
wherein each of the plurality of devices is further configured to:
capture video using the camera of the device; and
for each of the one or more additional camera sync times, determine that the additional camera sync time has passed, and, in response, determine a camera offset by calculating a difference between a timestamp time of a current frame captured by the device and the additional camera sync time, and then adjust one or more video capture parameters of the device based on said camera offset.
4 . The system of claim 1 , wherein each of the plurality of devices is configured such that, the adjusting of the one or more video capture parameters by the device comprises capturing a frame with an exposure time that is determined based on the first camera offset for the device.
5 . The system of claim 1 , wherein each of the plurality of devices is configured such that, the adjusting of the one or more video capture parameters by the device comprises temporarily increasing or decreasing a capture period for the device based on the first camera offset for the device.
6 . The system of claim 1 , wherein each of the plurality of devices is configured such that, the adjusting of the one or more video capture parameters by the device comprises ceasing video capture by the device for a period of time that is determined based on the first camera offset for the device.
7 . The system of claim 1 , wherein the at least one server is configured to:
store a current server time; and
transmit a request to each of the plurality of devices for a current device time,
wherein each of the plurality of devices is configured to transmit the current device time for the device to the at least one server, in response to receiving the request, and
wherein the at least one server is further configured to determine a first clock offset for each of the plurality of devices, using the current server time, the current device time for the device, and a transmission time for communication between the at least one server and the device.
8 . The system of claim 7 , wherein the at least one server is configured to:
determine a second clock offset for each of the plurality of devices; and
determine a clock drift for each of the plurality of devices by comparing the first and second clock offsets for the device.
9 . The system of claim 1 , wherein at least one of the plurality of devices is a smartphone.
10 . A method for synchronizing video capture by respective cameras of a plurality of devices, the method comprising:
determining a camera period for the cameras of the plurality of devices, wherein the camera period is a time interval that substantially corresponds with a respective frame capture interval configured at each of the plurality of electronic devices, the frame capture interval being the time between successive captured frames;
determining a first camera sync time, including by adding an integral number of camera periods to a synchronized clock value;
determining a second camera sync time, including by adding an integral number of camera periods to the first camera sync time;
capturing video at each of the plurality of devices, using the respective cameras of the plurality of devices;
at each of the plurality of devices, once the device has determined that the first camera sync time has passed, determining a first camera offset by calculating a difference between a timestamp time of a current frame captured by the device, and the first camera sync time; and
at each of the plurality of devices, calculating an adjustment to adjust one or more video capture parameters of the device based on said first camera offset, so that a second camera offset, which is a difference between a timestamp time for a subsequent frame captured by the device and the second camera sync time, is smaller than the first camera offset.
11 . The method of claim 10 , comprising, at each of the plurality of devices, comparing the first camera offset of the device with a threshold, wherein the adjusting of the one or more video capture parameters for the device is based on an amount by which the first camera offset for the device exceeds said threshold.
12 . The method of claim 10 , further comprising:
determining one or more additional camera sync times, including by, for each of the one or more additional camera sync times, adding said integral number of camera periods to an immediately preceding camera sync time;
capturing video using the camera of each of the plurality of devices; and
for each of the plurality of devices and for each of the one or more additional camera sync times, once the device has determined that the additional camera sync time has passed, determining a camera offset by calculating a difference between a timestamp time of a current frame captured by the device and the additional camera sync time, and then adjusting one or more video capture parameters of the device based on said camera offset.
13 . The method of claim 10 , wherein said adjusting comprises, for each of the one or more devices, triggering the device to capture a frame with an exposure time that is determined based on the first camera offset for the device.
14 . The method of claim 10 , wherein said adjusting comprises, for each of the one or more devices, temporarily increasing or decreasing a capture period for the device based on the first camera offset for the device.
15 . The method of claim 10 , wherein said adjusting comprises, for each of the one or more devices, ceasing video capture by the device for a period of time that is determined based on the first camera offset for the device.
16 . The method of claim 10 , wherein at least one of the plurality of devices is a smartphone.
17 . A device for capturing video, the device comprising: at least one processor; a camera; and a non-transitory computer readable storage medium comprising instructions, which, when executed by the at least one processor, cause the device to:
receive a synchronized clock value from at least one server;
determine a first camera sync time, including by adding an integral number of camera periods to the synchronized clock value, wherein a camera period is a time interval that substantially corresponds with a frame capture interval configured at the device, the frame capture interval being the time between successive frames captured by the device;
determine a second camera sync time, including by adding an integral number of camera periods to the first camera sync time;
capture video using the at least one camera;
determine that the camera sync time has passed, and, in response, determine a first camera offset by calculating a difference between a timestamp time for a current frame captured by the device, and the first camera sync time;
calculate an adjustment to adjust one or more video capture parameters of the device based on said first camera offset, so that a second camera offset, which is a difference between a timestamp time for a subsequent frame captured by the device and the second camera sync time, is smaller than the first camera offset; and
send the video to the at least one server.
18 . The device of claim 17 , wherein the instructions, when executed by the at least one processor, cause the device to:
determine one or more additional camera sync times, including by, for each of the one or more additional camera sync times, adding said integral number of camera periods to an immediately preceding camera sync time;
capture video using the camera; and
for each of the one or more additional camera sync times, once the device has determined that the additional camera sync time has passed, determine a camera offset by calculating a difference between a timestamp time of a current frame captured by the device and the additional camera sync time, and then adjust one or more video capture parameters of the device based on said camera offset.
19 . The device of claim 17 , wherein the device is a smartphone.