stacking folder camera

Discussions of Electronically Assisted Astronomy using the Live Stacking feature.
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

stacking folder camera

#1

Post by andromedacity »

Hi , I have been using Sharpcap with an Altair camera for some time . very pleased with that indeed!

Soon I will be getting a new scope and will need to go back to my dslr cannon t3i for imaging till I can afford a cooled cam.
I see that DSLR's are not supported at this time so I was going to use apt to get the images and then the
camera folder function on SharpCap (great idea BTW) to be able to use its live stacking (which i love)
Only problem is that the cannon file format is CR2.

Question: is it a real pain to implement loading of CR2 files?
this would solve the problem for me.
I have had no luck trying to use that 3rd party Ascom dslr driver at all , just freezes all the time for me.

If CR2's cant be implemented easily then does anyone know of a synchronous image converter utility that would continuously monitor a folder and when each new image arrives; convert it and save the converted file into another folder (you see where I'm going with this)
again this would solve the problem. Having to manually and periodically convert the captured files to tiff to dump into capture folder sort of takes away the immediacy of the SharpCap stacking vibe (which is what I like about it)

Of course Id much rather do it all in SC but hey..

Any help appreciated


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

Re: stacking folder camera

#2

Post by admin »

Hi,

There is a program called dcraw which will do raw file conversion for DSLR images. I think that is has a commandline option so that in theory you could write a batch file that would do something like

move files from CR2 folder to temp folder
dcraw on CR2 files in temp folder
move converted files to sharpcap monitored folder
repeat above steps

I think the double move with the conversion after the first move would help avoid converting files multiple times – only newly arrived files would be moved to the temp folder and then converted.

In theory there's the library that dcraw uses for the reading of CR2 files (libraw) that could be incorporated into SharpCap, but it looks like it may not be entirely simple, so the approach above will get you started much faster :-)

Cheers, Robin
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

Re: stacking folder camera

#3

Post by andromedacity »

Thanks for your suggestion Robin, I have not had much experience using/writing batch files but I will certainly have a look at it as an option
I'll let you know how it goes.

Dave.
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

Re: stacking folder camera

#4

Post by andromedacity »

Below is what I ended up with.

Its not optimised but it works!
If anyone with more experience with batch file programming would like to improve upon this.
For example it would be nice if it checks if a file has arrived before processing it
At the moment it will just blindly carry on converting and moving all files all of the time.
you will see errors in the command line window when there are no files to be processed yet etc...
But as I said it does actually work ok for me.

Grab all below, put in notepad and save as CR2 converter.bat (or whatever you want to call it)
DCRAW needs to be downloaded and put in same location as bat file (or set a path to it)

@echo off
echo.
echo.
echo Automatic CR2 TO TIFF Converter for Sharpcap - Dave Cherry.
echo.Uses the DCRAW cmd line CR2 converter which needs to be
echo.downloaded and placed in same directory as this bat file (or set a path to it).
echo.
echo.
set /p sourcedir=Please enter a source directory for your CR2 files :
rem c:\conversion_tests
echo Source folder set to:%sourcedir%
echo.
echo.
set /p destinationdir=Please enter a destination directory for your TIFF files :
rem c:\conversion_tests\converted
echo Destination folder set to:%destinationdir%
echo.
echo.
echo press any key to start continuous conversion (ctrl c to exit)
echo.
pause

cd %sourcedir%
:refresh
FOR %%G IN (*.CR2) do (
dcraw -w -W -T -6 %%G
move /y %sourcedir%\*.tiff %destinationdir%

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

Re: stacking folder camera

#5

Post by admin »

Hi,

That looks promising. The only thing that occurs to me is that the CR2 files will slowly build up in the source folder and each time the loop runs it will convert all of the CR2 files that are in the folder rather than just the new ones. That will get slower and slower as the files build up I think. You will need to look for a way to delete or move the old CR2 files out of the way.

Cheers, Robin
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

Re: stacking folder camera

#6

Post by andromedacity »

Ok following your suggestions Robin here is new version...
This will move CR2's into the created "CR2sFinishedWith" folder after conversion
It Will then just continuously wait for more CR2 Subs to arrive in the user entered source folder and convert them upon arrival!
It works!

@echo off
echo.
echo.
echo Automatic CR2 TO TIFF Converter v1.1 for Sharpcap - Dave Cherry.
echo.Uses the DCRAW cmd line CR2 converter which needs to be
echo.downloaded and placed in same directory as this bat file (or set a path to it).
echo.
echo.
set /p sourcedir=Please enter a source directory for your CR2 files :
rem C:\APT_Images\Camera_1\2019-12-19
echo Source folder set to:%sourcedir%
echo.
echo.
set /p destinationdir=Please enter a destination directory for your TIFF files (SharpCap Monitor folder) :
rem c:\conversion_tests\converted
echo Destination folder set to:%destinationdir%
echo.

echo press any key to start continuous conversion (ctrl c to exit)
echo.
pause
cd %sourcedir%
if not exist "CR2sFinishedWith\" md "CR2sFinishedWith"
rem creates a folder to put CR2 files in after they have been converted

:refresh

FOR %%G IN (*.CR2) do (
echo %%G
dcraw -w -W -T -6 %%G

rem ----other dcraw commands to try OPTION2: dcraw -r 1 1 1 1 -4 -T -S 32767 -k 0 -o 0 -q %%G
rem ----other dcraw commands to try OPTION3: dcraw -r 1 1 1 1 -4 -T -o 0 -q 0 -t %%G

move /y %%G CR2sFinishedWith
move /y %sourcedir%\*.tiff %destinationdir%

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

Re: stacking folder camera

#7

Post by admin »

Hi,

Good to hear that you got it working. It would be great to see some images that you capture using this technique :-)


Cheers, Robin
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

Re: stacking folder camera

#8

Post by andromedacity »

Thanks Robin,

I'll let you know how it goes, waiting for a clear night
and also waiting to get the new scope tomorrow of course!
Regards
Dave
andromedacity
Posts: 7
Joined: Tue Dec 17, 2019 12:55 pm

Re: stacking folder camera

#9

Post by andromedacity »

Have been using the stacking folder. 40 frames plus a pre-dark subtraction
Image looked great but when selecting "save exactly as seen" Sharpcap did nothing and the clear save and pause buttons on the action panel are now greyed out?
program has not crashed, everything running but this.
the save snapshot button on the right histogram panel is also non functional.

have left for 1/2 an hour but still does not come back to life. no ability to save at all, any ideas?
User avatar
admin
Site Admin
Posts: 13319
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: stacking folder camera

#10

Post by admin »

Hi,

Is it possible that the images in the folder have run out at the time that you press the button? I think typically the save button that you've used is triggered by the next frame arriving, but if the images of run out in the next frame will never arrive. It might be that pressing the button to go back one frame would trigger the save to happen. I will have to look into this!

Cheers, Robin
Post Reply