Using V4L2 API directly instead of using MMAPI


When using H264 encoder with MMAPI, we obtain a big latency. So we want to try to use v4l2 directly to see if we can reduce the latency. But when using " ioctl(fd, VIDIOC_QUERYCAP, &cap) ", cap returned is always NULL and we fail to obtain information about hardware.

1 ) So hope that someone help me to resolve the issue !

  1. If you ignore the “VIDIOC_QUERYCAP”, we can succeed to access the encoder ?


There is known one-frame delay but we currently have no plany for enhancement:

We suggest you use NvVideoEncoder class, but if you want to have your own implementation, other users may share their experience to help your case.

Thanks Danell for ur reply,

We use H264 encoder to compress 4096x2160 yuv frames. Sometimes we obtain 32 ms for encoder latency and sometimes it is 50 ms. What could the cause of this change, note that we use the same code.



Hi XuXiang,

Thanks for sharing your thread.