[mmapi] setFrameRate failed

Environment: L4T 28.1

Our application use MMAPI to encode video. Our capture framerate is 60fps, and we want to encode 30fps video, so we use "setFrameRate(30, 1)". But we get the statistical encode-framerate is 60fps. API "setFrameRate" does not appear to be in effect.

Is "setFrameRate" a effective API?

Please check [url]https://devtalk.nvidia.com/default/topic/1002773/jetson-tx2/about-the-timestamp-of-video-encoder/post/5208637/#5208637[/url]

Hi DaneLLL:
Thank you for reply.
I have used your attached package, and i can get correct timestamp. But fps is still wrong.

Can you share more information about ‘But fps is still wrong’?

Hi DaneLLL:
As you suggest,for encodeing 30fps, I used setFrameRate(300, 1), but framerate was still 60fps.“setFrameRate” does not appear to be in effect.

Hi wuyindong,
I don’t understand your issue. If you apply the package on r28.1 and setFrameRate(30, 1), you will see timestamps in 33ms interval. What do you mean framerate is still at 60fps? Can you share a sample code?

Hi DaneLLL:
In my application,include capture and encode:
1: use v4l2 api to capture video data, and data contains timestamp. Capture frame-rate is 60fps, timestamp interval is 16ms
2: set capture timestamp to encode by “v4l2_buf.flags |= V4L2_BUF_FLAG_TIMESTAMP_COPY”,

Now,I want to set encode frame-rate to 30fps, so use setFrameRate(30, 1), but I get timestamp from encode. timestamp interval is still 16ms, not 33ms.

Hi wuyingdong, for your case, please set ‘setFrameRate(30, 1)’ and not set ‘v4l2_buf.flags |= V4L2_BUF_FLAG_TIMESTAMP_COPY’.