Why sometimes I can set framerate sometimes I can't? Why I get the following when I try to get camera feed from Logitech webcam?

The driver changed the time per frame from X to Y


Sometimes it happens sometimes it doesn't.

How should I resolve this problem?
Note that camera has many different pixel_formats supported and they have different framerates specification. Check the pixel_format you used, it is likely that the default pixel_format does not support the framerate you want.