i am debugging per-frame SOF timing in a camera recording pipeline on a Jetson Xavier board. The timestamp read in the recording application is different from the frame timestamp read on the kernel side.
The code that reads the timestamp on the kernel side is:
struct timespec64 ts_sof, ts_eof;
ts_sof = ns_to_timespec64((s64)descr->status.sof_timestamp);
ts_eof = ns_to_timespec64((s64)descr->status.eof_timestamp);
trace_tegra_channel_capture_frame(“sof”, &ts_sof);
trace_tegra_channel_capture_frame(“eof”, &ts_eof);
The output log is:
kworker/0:7-142 [000] … 1197.746686: tegra_channel_capture_frame: sof:1223.782082080
kworker/0:7-142 [000] … 1197.786686: tegra_channel_capture_frame: sof:1223.822081984
kworker/0:7-142 [000] … 1197.826680: tegra_channel_capture_frame: sof:1223.862081856
kworker/0:7-142 [000] … 1197.866650: tegra_channel_capture_frame: sof:1223.902081728
kworker/0:7-142 [000] … 1197.906650: tegra_channel_capture_frame: sof:1223.942081600
kworker/0:7-142 [000] … 1197.946648: tegra_channel_capture_frame: sof:1223.982081504
The recording is done with gst-launch-1.0:gst-launch-1.0 -e nvarguscamerasrc sensor-id=0 sensor-mode=0 wbmode=1 ! “video/x-raw(memory:NVMM),format=NV12,width=5496,height=3694,framerate=25/1” ! nvvidconv ! “video/x-raw(memory:NVMM),width=2880,height=2880” ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=stretch.mp4
in file gstnvarguscamerasrc.cpp of this libgstnvarguscamerasrc.so
static const guint64 ground_clk = iFrame->getTime();
std::cout << "ground_clk = " << iFrame->getTime() << std::endl;
The output is:
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198036420000
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198136488000
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198199552000
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198247937000
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198287277000
10月 22 08:24:35 zzcomm-desktop bash[12102]: ground_clk = 1198320963000
So my questions are:
-
Where does the timestamp returned by
iFrame->getTime()come from? -
Is there source code available for the implementation of
getTime()? -
Is there an implemented way to obtain the
status.sof_timestampin our recard app?
Any help would be appreciated. Thank you.