GetLastCaptureFilename and Live Stacking

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Xio1996
Posts: 42
Joined: Fri Feb 21, 2020 10:15 am
Location: Isle of Wight, UK

GetLastCaptureFilename and Live Stacking

#1

Post by Xio1996 »

Hi Everybody,

I am trying to get the file location and name of the last saved stack while live stacking via scripting. I am using the Test Camera 1 (deep sky), to try this out. I tried the Folder Monitor camera as well.

Setting live stacking going I run the following script after a few frames.

Code: Select all

SharpCap.LiveStacking.SaveImageWithDisplayStretch()
print SharpCap.GetLastCaptureFilename()
Which results in 'None' being printed in the console, but the notification bar says a snapshot has been captured.

If I come out of LiveStacking and click on the Snapshot button, then calling SharpCap.GetLastCaptureFilename() returns the filename of the snapshot.

I am using 4.0.9455, 64 bit (07/11/2022).

Any help would be much appreciated.

Pete
User avatar
admin
Site Admin
Posts: 13350
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: GetLastCaptureFilename and Live Stacking

#2

Post by admin »

Hi Pete,

unfortunately the saving of images via live stacking doesn't feed through to the GetLastCaptureFilename() API - that only records images saved by the normal capture photo/video buttons/menus.

Unfortunately there doesn't seem to be a workaround for this via scripting at the moment - I will try to implement this in SharpCap 4.1 (currently in alpha testing).

cheers,

Robin
Xio1996
Posts: 42
Joined: Fri Feb 21, 2020 10:15 am
Location: Isle of Wight, UK

Re: GetLastCaptureFilename and Live Stacking

#3

Post by Xio1996 »

Hi Robin,

Thank you for taking a look.

As a workaround is there any way to read the notification message generated by a stack save. It's a little weird but it does contain the name of the stack file just written. Otherwise, I will just work out what SharpCap would have saved it as and get it that way.
Screenshot 2022-11-08 143810.png
Screenshot 2022-11-08 143810.png (78.69 KiB) Viewed 4343 times
Looking forward to 4.1

Pete
User avatar
admin
Site Admin
Posts: 13350
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: GetLastCaptureFilename and Live Stacking

#4

Post by admin »

Hi Pete,

the notification messages go into the log, so you could try to read from that. SharpCap opens the log file with 'share read' access, meaning another process (or other code in the same process) can open it in read-only mode without a conflict.

cheers,

Robin
Post Reply