I am using Gstreamer to record four IMX390 Leopard Imaging cameras at the same time with Python. I want to see if the cameras are streaming in synch, so I access the buffer timestamps (pts and dts), offset and duration and save them all to file.
By recording an external screen showing a timer, I can see that the four cameras seem to be in sync and capturing at 30 fps as they should.
The problem I have is that for each camera the timestamps saved to file seem to not be regular at all, in contrast to what their frames are showing. I am capturing at 30fps, so I am expecting the difference between consecutive timestamps to be around 33ms, but what I see instead varies between 10ms to 50ms. Moreover the two timestamps pts and dts are the same, and the offset and duration have no valid value.
Here is my input pipeline
def gstreamer_in(cam_id):
""" Creates string with gstreamer input pipeline """
gst_in = ('nvarguscamerasrc sensor-id={} ! '
'video/x-raw(memory:NVMM), height=1080, width=1920, framerate=(fraction)30/1, format=NV12 ! '
'nvvidconv ! video/x-raw, height=1080, width=1920, format=BGRx ! '
'videoconvert ! video/x-raw, format=BGR ! '
'appsink emit-signals=true sync=false').format(cam_id)
return gst_in
and here are a few of the values that I am getting
N frame,dts,pts,offset,duration
0,0:00:03.527208860,0:00:03.527208860,CLOCK_TIME_NONE,CLOCK_TIME_NONE
1,0:00:03.606427245,0:00:03.606427245,CLOCK_TIME_NONE,CLOCK_TIME_NONE
2,0:00:03.643383157,0:00:03.643383157,CLOCK_TIME_NONE,CLOCK_TIME_NONE
3,0:00:03.682110536,0:00:03.682110536,CLOCK_TIME_NONE,CLOCK_TIME_NONE
4,0:00:03.730528664,0:00:03.730528664,CLOCK_TIME_NONE,CLOCK_TIME_NONE
5,0:00:03.771878491,0:00:03.771878491,CLOCK_TIME_NONE,CLOCK_TIME_NONE
Even if frames look ok, I still need precise timestamps to be able to synchronize these captures with other events.
I tried to print the timestamps directly by command line and the results are the same, so I assume Python is not the problem here.
Would this be an issue in nvarguscamerasrc or the camera themselves?
I am a beginner in Gstreamer, any help about understanding what’s going on would be greatly appreciated.