NvVideoEncoder: different between output and capture plane format

Hello!
I see tegra_multimedia_api/samples/common/classes/NvVideoEncoder.cpp and I have question

int
NvVideoEncoder::setOutputPlaneFormat(uint32_t pixfmt, uint32_t width,
        uint32_t height)
{
    struct v4l2_format format;
    uint32_t num_bufferplanes;
    NvBuffer::NvBufferPlaneFormat planefmts[MAX_PLANES];

    if (pixfmt != V4L2_PIX_FMT_YUV420M && pixfmt != V4L2_PIX_FMT_YUV444M &&
        pixfmt != V4L2_PIX_FMT_P010M)
    {
........

NvVideoEncoder::setCapturePlaneFormat(uint32_t pixfmt, uint32_t width,
        uint32_t height, uint32_t sizeimage)
{
    struct v4l2_format format;

    memset(&format, 0, sizeof(struct v4l2_format));
    format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
    switch (pixfmt)
    {
        case V4L2_PIX_FMT_H264:
        case V4L2_PIX_FMT_H265:
        case V4L2_PIX_FMT_VP8:
        case V4L2_PIX_FMT_VP9:
.........

According to this code capture plane format is a encoder output, output plane format is encoder input, right?
But at same time setFrameRate() apply parameters to output plane, but if it encoder input this configure sensor framerate? So I can’t capture from sensor 60 fps and encode 30 fps?
Thank you.

Hi,

Yes.

setFrameRate() is to provide information of bitrate control. To encode 30fps and bitrate 4Mbps in constant bit rate mode, each frame has rough 4M/30 bits. For 60fps, it is 4M/60 bits. Sensor frame rate can be arbitrary and not required to be same as setFrameRate().