How to set Frame Rate in a script

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Mike C
Posts: 1
Joined: Tue Aug 17, 2021 10:00 pm

How to set Frame Rate in a script

#1

Post by Mike C »

I saw the question how to get the frame rate as a discussion, but I'd like to know if you can set the Frame rate to a specific value? I'd like to set it at 15fps. I'm running v4.1.10910.0 on a Win11Pro laptop with a NeptuneM camera.
Mike C
User avatar
admin
Site Admin
Posts: 13350
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: How to set Frame Rate in a script

#2

Post by admin »

Hi,

with most astro cameras, there is no setting to set the frame rate exactly (some cameras have this option if you use them via the DirectShow driver, but that limits control over the camera in other ways).

One thing you can do is set the exposure to about 66ms - that will give you roughly 15fps. If that doesn't fit the way you want to use the camera then you can set the 'Frame Rate Limit' control to 15fps, but that isn't an exact setting... With the frame rate limit, SharpCap will continue to let the camera run at its own rate but ignore frames from the camera to bring the number of frames processed per second to roughly the rate chosen. That means that if your camera is producing 25fps with no limiting applied, SharpCap will throw away about 10 frames per second to get to a value of approximately 15fps.

To set the frame rate limit via scripting, you need to find the control amongst the various other controls of the camera.

Code: Select all

 SharpCap.SelectedCamera.Controls.FindByName("Frame Rate Limit").Value = "15 fps"
Hope this helps,

Robin
JacquesTalbot2
Posts: 7
Joined: Sun Feb 25, 2024 4:11 pm

Re: How to set Frame Rate in a script

#3

Post by JacquesTalbot2 »

I found why the Gain control is not there: It is because I was using Camera V3 Simulator who doesn't have a Gain control
Post Reply