Hi, I’m using multimedia api in jetson tx2 (R32.6.1, R32.7.4)
I’m wrote code based on multimedia api sample. (video_decode_main)
Recently, I have decoding issue when v4l2_buf.timestamp.tv_sec over 1844674407370 decimal value.
When I queue v4l2_buf has timestamp.tv_sec 1844674407371 in output plane, (decoder->output_plane.qBuffer(v4l2_buf, nullptr))
v4l2_buffer in dequeued buffer at capture_plane has 0 in v4l2_buf.
everytime exactly tv_sec value is over than 1844674407371, problem occured.
timestamp.tv_sec allocates 8bytes, so it couldn’t be happen.
Linux VADevice_000322654554 4.9.337 #12 SMP PREEMPT Wed Aug 30 17:23:55 KST 2023 aarch64 aarch64 aarch64 GNU/Linux
I used rootfs from tools/sampelfs/nv_build_samplefs.sh
and
I installed nvidia-cuda, nvidia-cudnn8, nvidia-l4t-jetson-multimedia-api, nvidia-opencv using apt
I edited vi4.c line 296 string from
“using default number of vi channels,%d\n” to
" modified (only_pr_info) using default number of vi channels"
I can see changes in dmesg but I can’t see vi4_fops change in dmesg
I’m receiving H.264 stream via ethernet. Also this uses vi4_fops?
I tried to find why program stopped, and I found timestamp goes back to 0 in v4l2_buf from dequed capture plane when I put 1844674407371 value in v4l2_buf.timestamp.tv_sec and queue buffer to output plane. (1 for 1844674407372, 2 for 1844674407373 …)
Regardless of source, I manually put timestamp value in v4l2_buf.
I can’t upload full source, but this is how I manualy put timestamp and frame to v4l2_buf
struct v4l2_buffer v4l2_buf;
struct v4l2_plane planes[MAX_PLANES];
memset(&v4l2_buf, 0, sizeof(v4l2_buf));
memset(&(planes[0]), 0, sizeof(planes));
if (NvBuffer* buffer = getOutputBuffer(&v4l2_buf, &(planes[0]))) {
if ((v4l2_buf.flags & V4L2_BUF_FLAG_ERROR) != 0) {
printf(LP_ERR, L"V4L2_BUF_FLAG_ERROR"); //< for test.
}
if (_param.inputNalUnit()) {
/* read the input nal unit. /
}
else {
/ read the input chunks. /
read_decoder_input_chunk(frame, buffer);
}
v4l2_buf.m.planes[0].bytesused = buffer->planes[0].bytesused;
v4l2_buf.flags |= V4L2_BUF_FLAG_TIMESTAMP_COPY;
v4l2_buf.timestamp.tv_sec = frame.bufferCount();
v4l2_buf.timestamp.tv_usec = 0;
auto const decoder = _videoContext->decoder();
if (checkError(decoder->output_plane.qBuffer(v4l2_buf, nullptr), “Error Qing buffer at output plane”)) { //< enqueue.
_videoContext->abort();
return;
}