Would it be possible to provide script control from outside of Sharpcap, something like an API? I'm a NINA contributor and would like to provide a way to launch Sharpcap and drive it to take video, since that is an area (high frame rate capture) we don't expect to take NINA into.
The scenario I have in mind is something like this:
1. Drive the mount to the object
2. Autofocus at a nearby location, and plate solve + sync
3. Where possible, use some mount-specific capabilities. In my case, I have a 10 micron plugin that will be able to use loaded TLE data to track comets and satellites
4. At the start of a transit, set the position and tracking rate accordingly, and launch Sharpcap to capture video. NINA could even change filters and handle focuser offsets (which are already supported)
Script Control from Outside Sharpcap
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
- admin
- Site Admin
- Posts: 13344
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Script Control from Outside Sharpcap
Hi,
if you are happy coding (and I guess you are as a NINA contributor), then you should be able to build this from the features currently available in SharpCap...
1) Built in Python scripting (Iron Python based) - if you search for 'SharpCap Pyro4' you will find some posts about using the Pyro python remoting from within SharpCap and calling it from outside. If this doesn't fit the bill, then you could probably host either an HTTP server or a simple TCP server from the python scripting to receive commands. Note that the API objects that SharpCap makes available to the python environment to control the application are not remotable, but you could build pure python wrappers around them
2) The python scripting can manipulate the SharpCap application/camera/hardware directly, or can be used to launch SharpCap sequencer commands for more complicated actions
3) SharpCap can be configured to run python scripts on startup, allowing for this to be configured automatically each time you run SharpCap. There is also a '/runscript' command line argument, so that you could have SharpCap launched with that argument when remote control was required.
I would point out that both the python scripting and the sequencer in SharpCap are 'Pro' features and therefore require a license.
Hope this helps - happy to provide more details if it is of interest,
cheers,
Robin
if you are happy coding (and I guess you are as a NINA contributor), then you should be able to build this from the features currently available in SharpCap...
1) Built in Python scripting (Iron Python based) - if you search for 'SharpCap Pyro4' you will find some posts about using the Pyro python remoting from within SharpCap and calling it from outside. If this doesn't fit the bill, then you could probably host either an HTTP server or a simple TCP server from the python scripting to receive commands. Note that the API objects that SharpCap makes available to the python environment to control the application are not remotable, but you could build pure python wrappers around them
2) The python scripting can manipulate the SharpCap application/camera/hardware directly, or can be used to launch SharpCap sequencer commands for more complicated actions
3) SharpCap can be configured to run python scripts on startup, allowing for this to be configured automatically each time you run SharpCap. There is also a '/runscript' command line argument, so that you could have SharpCap launched with that argument when remote control was required.
I would point out that both the python scripting and the sequencer in SharpCap are 'Pro' features and therefore require a license.
Hope this helps - happy to provide more details if it is of interest,
cheers,
Robin
Re: Script Control from Outside Sharpcap
Thanks for the pointer, Robin! This looks really promising, particularly if I can get pyrolite working.
Is it possible to launch Sharpcap and have it run a script, or does this need to be done manually? I'm inclined to require this to be done manually anyways (to connect a camera as well), but it would be good to know regardless.
Is it possible to launch Sharpcap and have it run a script, or does this need to be done manually? I'm inclined to require this to be done manually anyways (to connect a camera as well), but it would be good to know regardless.
- admin
- Site Admin
- Posts: 13344
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Script Control from Outside Sharpcap
Hi,
you can run python scripts at startup, either via configuring them to run every time in the settings, or via the /runscript command line parameter.
SharpCap can be set up to automatically reopen the last used camera on startup, but it may be safer to have your script open the camera (or even do that via remoting once the remoting is up and running)
cheers,
Robin
you can run python scripts at startup, either via configuring them to run every time in the settings, or via the /runscript command line parameter.
SharpCap can be set up to automatically reopen the last used camera on startup, but it may be safer to have your script open the camera (or even do that via remoting once the remoting is up and running)
cheers,
Robin
Re: Script Control from Outside Sharpcap
Excellent, thanks Robin! I expect to give this a go in a few weeks and hopefully report back some success.