I obtain camera time using following function:
arv_buffer_get_timestamp()
I get camera time in nano seconds. To sync it, I subtract it from the current system clock time, which is basically time_since_epoch. This gives me an offset. For all other images, I just add this offset to the subsequent camera times. Now, this image time is gradually lagging behind the system time. This lag increases with every frame.
Is the software taking less images than fps? Is my method for calculating image time incorrect?
Hi,
Which camera model ?
The buffer timestamp is normally set by the camera, and if its time is not synchronized to a reference time using ptp, it will drift wrt the receiving system time.
I use evk. I am not sure it has the ptp protocol option. I will check for it.
My camera model doesn’t support ptp. Is there any other way I can sync them?
It depends on what you want to achieve. If you want an exact number of images per second, you may use, if supported by your device, an external trigger signal.
Or if you want a timestamp that does not drift over time, use arv_buffer_get_system_timestamp() instead of arv_buffer_get_timestamp(), that will give the system time at the completion of the image reception.
1 Like
Thanks for your suggestion. But with arv_buffer_get_system_timestamp(), the difference between system clock and time stamp of first image is 0.6 ms, which is approximately equal to the difference between two images at 1600 fps. This difference remains consistent for all other frames. So, I believe I am getting one old image. Do you know why this might be happening?
Hi,
buffer→system_tymestamp is the time at the reception of the first data packet of a given image. When you get a buffer from the buffer queue, the difference between the current system time and the buffer timestamp correspond to the image acquisition duration. This is probably the image acquisition period if you are at the maximum acquisition frame rate.
Emmanuel.
Understood, so according to your statement, the image grab time should be more than the current system time, then how is it less than the current system time?