Skip to content

Not setting desired_fps results in lower jpeg capture fps than expected #316

@aggieNick02

Description

@aggieNick02

I noticed that when I was watching a served mjpeg stream or reading a jpeg sink, the maximum fps I would see was around 62-63 fps, despite the source being 120 or 144fps. If I switched to a raw sink, I would read at the expected fps.

I traced this to this line that sets the interval for run->refresher:

interval.tv_usec = 16000; // ~60fps

It seems like instead we should be doing something like the following, but wasn't 100% sure about it:

		uint fps_to_use=0
		if (stream->cap->desired_fps > 0) {
			fps_to_use=stream->cap->desired_fps;
		} else {
			fps_to_use=stream->cap->run->hw_fps;
		}
		if (fps_to_use>0) {
			interval.tv_usec = 1000000 / (fps_to_use * 2);
		} else {
			interval.tv_usec = 16000; // ~60fps
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions