CameraDevice的时间戳的时基是什么
What is the timebase of the timestamp of CameraDevice
我 运行 遇到时间戳问题,如果有人能帮助我,我将不胜感激。我正在尝试将 SensorEvent 同步到我从 ImageReader 接收到的图像。
我知道 SensorEvent 的时间戳是操作系统启动后的纳秒数(正常运行时间)。
另一方面,图像(来自 ImageReader)的 getTimestamp 以纳秒为单位测量,但时基取决于提供图像的来源(相机、相机设备等)。就我而言,我使用的是 CameraDevice (camera2),但我还没有找到 CameraDevice 的时基。
如有任何帮助,我将不胜感激。
干杯
这已记录在 SENSOR_INFO_TIMESTAMP_SOURCE 字段中,尽管在两个选项中,第一个可能对您没有帮助。
未知:"Timestamps from android.sensor.timestamp are in nanoseconds and monotonic, but can not be compared to timestamps from other subsystems (e.g. accelerometer, gyro etc.), or other instances of the same or different camera devices in the same system. Timestamps between streams and results for a single camera instance are comparable, and the timestamps for all buffers and the result metadata generated by a single capture are identical."
实时:"Timestamps from android.sensor.timestamp are in the same timebase as elapsedRealtimeNanos(), and they can be compared to other timestamps using that base."
不幸的是,现在大多数设备都报告未知,因为它们与 elapsedRealtimeNanos() (which at the Linux kernel level, is generally the CLOCK_BOOTTIME 时间源使用的时基没有精确同步。
然而,在实践中,大多数设备的相机时间戳仅来自 CLOCK_MONOTONIC 源,通常与 nanoTime() 的时基相同。
但是时间戳通常不是很准确(意思是相差几毫秒),这就是这些设备报告未知的原因,因为时间戳的准确性不够高,无法可靠地与其他传感器的时间戳相关联。
我 运行 遇到时间戳问题,如果有人能帮助我,我将不胜感激。我正在尝试将 SensorEvent 同步到我从 ImageReader 接收到的图像。
我知道 SensorEvent 的时间戳是操作系统启动后的纳秒数(正常运行时间)。 另一方面,图像(来自 ImageReader)的 getTimestamp 以纳秒为单位测量,但时基取决于提供图像的来源(相机、相机设备等)。就我而言,我使用的是 CameraDevice (camera2),但我还没有找到 CameraDevice 的时基。
如有任何帮助,我将不胜感激。 干杯
这已记录在 SENSOR_INFO_TIMESTAMP_SOURCE 字段中,尽管在两个选项中,第一个可能对您没有帮助。
未知:"Timestamps from android.sensor.timestamp are in nanoseconds and monotonic, but can not be compared to timestamps from other subsystems (e.g. accelerometer, gyro etc.), or other instances of the same or different camera devices in the same system. Timestamps between streams and results for a single camera instance are comparable, and the timestamps for all buffers and the result metadata generated by a single capture are identical."
实时:"Timestamps from android.sensor.timestamp are in the same timebase as elapsedRealtimeNanos(), and they can be compared to other timestamps using that base."
不幸的是,现在大多数设备都报告未知,因为它们与 elapsedRealtimeNanos() (which at the Linux kernel level, is generally the CLOCK_BOOTTIME 时间源使用的时基没有精确同步。
然而,在实践中,大多数设备的相机时间戳仅来自 CLOCK_MONOTONIC 源,通常与 nanoTime() 的时基相同。
但是时间戳通常不是很准确(意思是相差几毫秒),这就是这些设备报告未知的原因,因为时间戳的准确性不够高,无法可靠地与其他传感器的时间戳相关联。