Solution 1 :
according to official documentation https://developer.android.com/reference/androidx/camera/core/ImageInfo#getTimestamp() image timestamp is a long, which means that as every timestamp, it returns the number of milliseconds from January 1st 1970.
Problem :
I want to get the CameraX(analyzer) frame created timestamp, but when I use imageProxy.getImageInfo().getTimestamp()
I get a timestamp that is shorter than System.currentTimeMillis()
, so I think they are not same timestamp style.
how can I transfer it to normal timestamp like the stamp of System.currentTimeMillis()
.
thanks @LexFerrinson, the
imageProxy.getImageInfo().getTimestamp()
is here https://developer.android.com/reference/androidx/camera/core/ImageInfo#getTimestamp() but I dont know how to transfer it to currentTimeMillis.
for example:
2022-06-13 15:33:52.539 ... D/l: System.currentTimeMillis():1,655,102,032,539
2022-06-13 15:33:52.578 ... D/l: imageProxy.getImageInfo().getTimestamp():17,268,452,439,387
I got the timestamp form camerax analyzer
cameraX version:
implementation "androidx.camera:camera-camera2:1.1.0-alpha09"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha09"
implementation "androidx.camera:camera-view:1.0.0-alpha29"
implementation "androidx.camera:camera-core:1.1.0-alpha29"
thanks!
Comments
Comment posted by normidar
what about
Comment posted by normidar
I saw the document before your answer but I cant understand it.
Comment posted by LexFerrinson
@normidar if you get the currentTImeMillis() and you convert it to date format with
Comment posted by normidar
did you do it ? they are different timestamp.
Comment posted by LexFerrinson
@normidar should they have same timestamp? Is the picture created in your program or is it a stored picture that you get from elsewhere? Could you give me both timestamp longs?