Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4l2compress encodes as fast as possible instead of at device FPS #35

Open
gabenell opened this issue Sep 23, 2020 · 3 comments
Open

v4l2compress encodes as fast as possible instead of at device FPS #35

gabenell opened this issue Sep 23, 2020 · 3 comments

Comments

@gabenell
Copy link

I noticed that v4l2compress uses 100% CPU when running, and that when I serve the output of v4l2compress using v4l2rtspserver, it sends hundreds of FPS. My video source is a v4l2loopback device.

The problem seems to be the while loop in v4l2compress.cpp, which encodes as fast as possible. I verified by adding a sleep that the CPU usage dropped and the FPS received by the RTSP client went down to a sane rate.

Is there any way to make v4l2compress run at the native framerate of the source device? Trying to achieve this by sleeping is not ideal.

@flixman
Copy link

flixman commented Jul 24, 2021

@gabenell I find myself on this same situation. Did you manage to get it fixed? Where did you put the sleep, as a fallback option?

Edit: I just put it at the end of the loop, but when serving the stream through v4l2rtspserver now I get a static image :-/.

@fplanque
Copy link

Even when using a USB camera as source, how would one decide to compress a 15fps stream instead of the max 30fps stream?

There is no framerate option for v4l2compress nor v4l2compress_omx.

Also I don't see how I could modify the device framerate with v4l2-ctl ... ?

Thank you.

@mpromonet
Copy link
Owner

Hi @fplanque

This tools are not setting fps, you should set it using v4l2-ctl --set-parm.

Best Regards,
Michel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants