Folder Monitor Camera and Live Stacking

A place to report problems and bugs in SharpCap
Forum rules
Please read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by PM ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
djd
Posts: 4
Joined: Mon Nov 12, 2018 10:54 pm

Folder Monitor Camera and Live Stacking

Post by djd » Wed Nov 28, 2018 11:40 pm

Hi,
I have a camera (Z-Cam E1) that is taking a .JPG every 8 seconds and saving them to
the folder specified in the Camera Controls pane. The "Status:" field in Camera
Controls pane increments up for each new .JPG that is saved to the folder - the
Folder Monitor Camera part of SharpCap is seeing that .JPG's are being placed in the
folder by the Camera.

But Live Stacking does not see there are new images being added to
the folder of the Folder Monitor Camera. In the Information pane of Live Stacking the
message remains Status:Waiting for Next Frame as the images are being added to the
folder one at a time every 8 seconds.

Live Stacking will stack a folder already containing saved .JPG's. If I leave Live
Stacking running after it stacks all the .JPG's in that folder, and have the camera start adding more
JPG's I get same "Waiting for Next Frame".
It does not see any new files being added to the folder that was stacked successfully.

It seems the behavior is maybe Live Stacking checks the folder only once when it is
initialized.. Maybe it counts the total number of files in the folder, and stacks only that
total number it saw initially? My experience is Live Stacking does not see any additional JPG being
added to the folder of successfully stacked images, nor will it stack any
JPG's added to an empty folder. Maybe the frequency / method that Live Stacking uses
to check the folder for files needs to be modified?

Thanks!
D

Demo Version 3.2.5874.0 - 11/21/2018
Windows 7

User avatar
turfpit
Posts: 522
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: Folder Monitor Camera and Live Stacking

Post by turfpit » Thu Nov 29, 2018 12:41 am

D

Have a read at this post viewtopic.php?f=38&t=958&start=20#p4949

Dave

djd
Posts: 4
Joined: Mon Nov 12, 2018 10:54 pm

Re: Folder Monitor Camera and Live Stacking

Post by djd » Thu Nov 29, 2018 2:32 am

Hi Dave,

Thanks for the link to the thread with Robin's instructions!
My mistake was not selecting the All in Folder button per step 2.

Cheers!
D

User avatar
turfpit
Posts: 522
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: Folder Monitor Camera and Live Stacking

Post by turfpit » Thu Nov 29, 2018 8:00 am

D

Glad it is working for you now. Folder Monitor is a fairly new feature and is 'evolving'.

The Search facility at the top right of the forum page is a useful tool for taming the large amount of information stored in all the posts.

Dave

djd
Posts: 4
Joined: Mon Nov 12, 2018 10:54 pm

Re: Folder Monitor Camera and Live Stacking

Post by djd » Fri Dec 07, 2018 8:26 pm

An update. Firstly, thanks for the wonderful software and this forum. I had a couple clear nights to try Live Stacking with Folder Monitor Camera again and found that the issue I described above is still present - but I did come up with a workaround.

I initially thought the snag was me not using "All in Folder" button as I was able to get live stacking and folder monitor camera to work by following Robin's steps that were kindly provided by Dave (move a file into the monitored folder and repeatedly cut and paste).

But, I found if the files are created on a different location (SD card of camera) and then moved into the monitored folder, Live Stacking does not stack them as come in. The status: counter in camera control does see the files being added one at time, but live stacking does not.

Thinking some kind of permissions issue, I experimented by moving files from a network shared folder (confimred read/write permissions) into the monitoring folder on local hard drive, and got same result - The status: counter in camera control does see the files being added one at time, but live stacking does not.

It seems Live Stacking works fine if the files going into the monitored folder are sourced from the same drive the monitoring folder is located on, but not from a camera.

My workaround is to not move files directly from SD Card of the camera to monitoring folder. Instead files go from SD Card to a folder located on same local drive as monitoring folder and then are moved from that folder into monitoring folder. Not elegant, but effective.

Hopefully this info is helpful to someone else is using SharpCap this way. Maybe useful info for a fix in a later release? Like Dave says the folder monitor feature is new and evolving. With a little bit of workaround it is allowing me to Live Stack using an inexpensive camera without ASCOM or native drivers and that is a fantastic feature.

Cheers,
D

SharpCap Pro Version 3.2.5874.0
Win 7 Pro 64 bit and Win 10 Home 64 Bit
Zcam E1 and a powershell script

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

Re: Folder Monitor Camera and Live Stacking

Post by admin » Fri Dec 07, 2018 10:31 pm

Hi,

thanks for the update on what you've discovered so far. I guess what surprises me most is not the fact that doing it from a different drive has a different effect, but the fact that the folder Monitor camera seems to see the new files which ever way you do it but live stacking only operates on them if you copy the files from the same drive. That's very weird....

Anyway, now that I have a better understanding of what's working and what isn't, hopefully I have a chance of working out what the problem is.

Cheers, Robin

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

Re: Folder Monitor Camera and Live Stacking

Post by admin » Fri Dec 07, 2018 10:38 pm

Okay, quick update.

Just tested with them PNG files and I found that life stacking picked up the new files from the folder Monitor camera regardless of where I copied them from. I tried bringing them in from a different hard disk on the same machine and from a network drive and from the same hard disk and it picked up the new files in all 3 cases. I was using Windows Explorer to copy the files. I wonder if that might be another factor – i.e. using different software to copy the files may have an impact on the outcome.

Could you give an outline of exactly what software you are using to move the files around both in the working and the nonworking cases please?

Cheers, Robin

djd
Posts: 4
Joined: Mon Nov 12, 2018 10:54 pm

Re: Folder Monitor Camera and Live Stacking

Post by djd » Fri Dec 07, 2018 11:49 pm

Hi Robin,

Thanks for fast reply! Yes a weird issue. After your testing it sounds like a unique case limited to my setup, so thanks for digging deeper into it!

The camera can be managed remotely via HTTP GET and I control it with powershell on win7 pro connected over IP to the camera

In powershell script I use System.Net.WebClient.DownloadFile to download .JPG from the camera's SD card to the local drive.

I'd expect some wierdness with my script. Maybe something to do with downloading vs moving files.

The workaround was - after powershell downloaded the .JPG from the SD Card to a local drive folder I added more scripting to have it move that JPG to another folder on same local drive. I used Move-Item cmdlet for that. and it live stacks fine after that so all good there!

But the network share to monitored folder on local drive not stacking is really odd.

That was a standard drag and drop of .JPG's one at a time from the network share folder to the monitored folder on local drive using Windows Explorer on Win10 home. I just tried it again with same result on Win7 Pro.

If you need some logs or anything else, just let me know.

Cheers, D

celkins
Posts: 14
Joined: Fri Apr 20, 2018 10:58 pm

Re: Folder Monitor Camera and Live Stacking

Post by celkins » Sat Dec 08, 2018 9:20 pm

Sorry to chime in, but some thoughts that might help...
djd wrote:
Fri Dec 07, 2018 11:49 pm
Hi Robin,

Thanks for fast reply! Yes a weird issue. After your testing it sounds like a unique case limited to my setup, so thanks for digging deeper into it!

The camera can be managed remotely via HTTP GET and I control it with powershell on win7 pro connected over IP to the camera

In powershell script I use System.Net.WebClient.DownloadFile to download .JPG from the camera's SD card to the local drive.

I'd expect some wierdness with my script. Maybe something to do with downloading vs moving files.
I’d expect this to be a significant difference (speaking as a former software developer): downloading the file via HTTP almost certainly opens the file for writing at zero length, and then writes until finished; it *could* possibly determine the length in advance, but that depends on the ‘server’ side supporting this. Moving a file locally (same disc) is, however, typically an atomic operation, since in effect, it is only an update to the directory locations; moving from a different disc, network share etc. is similar to the first situation - create file, write content, update metadata.
The workaround was - after powershell downloaded the .JPG from the SD Card to a local drive folder I added more scripting to have it move that JPG to another folder on same local drive. I used Move-Item cmdlet for that. and it live stacks fine after that so all good there!

But the network share to monitored folder on local drive not stacking is really odd.

That was a standard drag and drop of .JPG's one at a time from the network share folder to the monitored folder on local drive using Windows Explorer on Win10 home. I just tried it again with same result on Win7 Pro.

If you need some logs or anything else, just let me know.

Cheers, D
Carl

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

Re: Folder Monitor Camera and Live Stacking

Post by admin » Sun Dec 09, 2018 2:48 pm

Hi,

yes, I think Carl is right that the problem is that the file gets created empty when you fetch it from the HTTP server. That's enough for SharpCap to pick up on a new file being in the folder, but when it checks the file to see if it is suitable for use it finds that it can't read it as an image and then ignores it. I guess I ought to do something in the code to watch for this sort of situation perhaps by ignoring a new father appears until it is possible to take an exclusive read/write lock on it which should stop SharpCap from looking at it until any other application that is accessing that file has closed it.

Cheers, Robin

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest