Dear forum,
I've just started using Sharpcap v4.1.12854.0 with my brand new Player One Ares Pro camera.
Camera control is working fine.
The problem happens as soon as I want to capture frames.
The ROI is 3008x3008
The bit depth is 16 bit.
I tried all file formats (JPEG (as 8 bit), TIFF, FITS, JPEG etc).
Upon saving the first frame I get an error : SharpCap has encountered an error.
Here is an extract of the log file where the error happens :
Debug 23:16:26.421499 #12 Creating directory F:\Astro\2024.12.24_IC434\2024-12-24\Capture\23_16_26 for capture files in string SharpCap.Base.FileWriters.TemplatedFilenameProvider.GenerateFilenameAndDirectory(FrameInfo frameInfo, bool createDir)
Info 23:16:26.444501 #12 Writing capture settings file to F:\Astro\2024.12.24_IC434\2024-12-24\Capture\23_16_26\Capture_00001.CameraSettings.txt in void SharpCap.Models.Camera.WriteCaptureSettingsTextAndHistogram(bool writeHistogram, string filename, string contents)
Info 23:16:26.542506 #12 SaveImage called with parameters : 3008x3008x1x8 bits, data=0x1AD10000, raw=0, dataTypeFlags = 0, stride=3008, C:\Users\acanicio\AppData\Local\Temp\tmpislwaw.tmp.tif, 0 in void SharpCap.Base.OpenCVFrameExtensions+FrameDisposer.Dispose()
Error 23:16:26.583509 #12 Writing frame : Exception of type 'BadImageFormatException' : Tentative de chargement d’un programme de format incorrect. (0x8007000B)
Stack Trace: at void SharpCap.Base.OpenCVFrameExtensions.SaveImage(ResultData result, FrameWrapper frameData, string filePath, int compressionSettings)
at TRet SharpCap.Base.OpenCVFrameExtensions+ActionRunner<TRet, TInter, TParser>.Run<T1>(Action<ResultData, T1> func, string action, T1 targetFrame)+(ResultData rd) => { } in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/OpenCVInterop.cs:line 213
at TRet SharpCap.Base.OpenCVFrameExtensions+ActionRunner<TRet, TInter, TParser>.RunActionWithErrorHandling(INeedToLogParams needToLogParameters, string action, Action<ResultData> func) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/OpenCVInterop.cs:line 272
at TRet SharpCap.Base.OpenCVFrameExtensions+ActionRunner<TRet, TInter, TParser>.Run<T1, T2>(Action<ResultData, FrameWrapper, T1, T2> func, string action, FrameWrapper targetFrame, T1 param1, T2 param2) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/OpenCVInterop.cs:line 213
at bool SharpCap.Base.OpenCVFrameExtensions.SaveImage(ICapturedFrame frame, string filename, int compressionSettings) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/OpenCVFrameExtensions.cs:line 220
at void SharpCap.Base.FileWriters.OpenCvFileWriter.WriteFrameImpl(FrameReference frameRef) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/FileWriters/OpenCvFileWriter.cs:line 31
at void SharpCap.Base.FileWriters.FileWriterBase.WriteFrame(FrameReference frame) in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/FileWriters/FileWriterBase.cs:line 190
at void SharpCap.Base.BaseImageProvider.RunWriteThread() in C:/Documents/Source Code/SharpCap/src/SharpCap.Base/BaseImageProvider.cs:line 331 in void SharpCap.Base.BaseImageProvider.RunWriteThread()
Warning 23:16:26.749518 #12 AppDomain Unhandled exception event recevied for System.BadImageFormatException: Tentative de chargement d’un programme de format incorrect. (0x8007000B)
at SharpCap.Base.OpenCVFrameExtensions.SaveImage(ResultData result, FrameWrapper frameData, String filePath, Int32 compressionSettings)
at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.<>c__DisplayClass2_0`2.<Run>b__0(ResultData rd) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 213
at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.RunActionWithErrorHandling(INeedToLogParams needToLogParameters, String action, Action`1 func) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 272
at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.Run[T1,T2](Action`4 func, String action, FrameWrapper targetFrame, T1 param1, T2 param2) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 213
at SharpCap.Base.OpenCVFrameExtensions.SaveImage(ICapturedFrame frame, String filename, Int32 compressionSettings) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVFrameExtensions.cs:line 220
at SharpCap.Base.FileWriters.OpenCvFileWriter.WriteFrameImpl(FrameReference frameRef) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\FileWriters\OpenCvFileWriter.cs:line 31
at SharpCap.Base.FileWriters.FileWriterBase.WriteFrame(FrameReference frame) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\FileWriters\FileWriterBase.cs:line 190
at SharpCap.Base.BaseImageProvider.RunWriteThread() in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\BaseImageProvider.cs:line 331
at SharpCap.Base.BaseImageProvider.CaptureWriteThreadProc() in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\BaseImageProvider.cs:line 263
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state), Terminating=True in void SharpCap.BugReporting.CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
Warning 23:16:26.816522 #12 Starting error processing on : Exception of type 'BadImageFormatException' : Tentative de chargement d’un programme de format incorrect. (0x8007000B) () in bool SharpCap.BugReporting.ShouldReportException(Exception exception)
Info 23:16:26.820522 #12 Considering if the error needs to be reported : System.BadImageFormatException("Tentative de chargement d’un programme de format incorrect. (0x8007000B)") in bool SharpCap.BugReporting.WorkOutIfWeShouldReport(Exception exception)
Info 23:16:26.857524 #12 Checking to see if error 'Tentative de chargement d’un programme de format incorrect. (0x8007000B)' is caused by ASCOM drivers or other third party code. in bool SharpCap.NonReportableExceptions.HandleThirdPartyException(Exception e, IApplication app)
Info 23:16:26.928528 #12 Error needs to be reported : 'Tentative de chargement d’un programme de format incorrect. (0x8007000B)' of type System.BadImageFormatException at at SharpCap.Base.OpenCVFrameExtensions.SaveImage(ResultData result, FrameWrapper frameData, String filePath, Int32 compressionSettings) at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.<>c__DisplayClass2_0`2.<Run>b__0(ResultData rd) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 213 at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.RunActionWithErrorHandling(INeedToLogParams needToLogParameters, String action, Action`1 func) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 272 at SharpCap.Base.OpenCVFrameExtensions.ActionRunner`3.Run[T1,T2](Action`4 func, String action, FrameWrapper targetFrame, T1 param1, T2 param2) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVInterop.cs:line 213 at SharpCap.Base.OpenCVFrameExtensions.SaveImage(ICapturedFrame frame, String filename, Int32 compressionSettings) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\OpenCVFrameExtensions.cs:line 220 at SharpCap.Base.FileWriters.OpenCvFileWriter.WriteFrameImpl(FrameReference frameRef) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\FileWriters\OpenCvFileWriter.cs:line 31 at SharpCap.Base.FileWriters.FileWriterBase.WriteFrame(FrameReference frame) in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\FileWriters\FileWriterBase.cs:line 190 at SharpCap.Base.BaseImageProvider.RunWriteThread() in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\BaseImageProvider.cs:line 331 at SharpCap.Base.BaseImageProvider.CaptureWriteThreadProc() in C:\Documents\Source Code\SharpCap\src\SharpCap.Base\BaseImageProvider.cs:line 263 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in bool SharpCap.BugReporting.ShouldReportException(Exception exception)
Warning 23:16:27.034534 #12 Exception Preprocessing on System.BadImageFormatException 'Tentative de chargement d’un programme de format incorrect. (0x8007000B)' : Exception of type 'BadImageFormatException' : Tentative de chargement d’un programme de format incorrect. (0x8007000B) () in Exception SharpCap.BugReporting.PreprocessException(Exception arg)
Warning 23:16:27.090538 #12 Creating bug report due to exception : : Exception of type 'BadImageFormatException' : Tentative de chargement d’un programme de format incorrect. (0x8007000B) () in void SharpCap.BugReporting.SettingsOnProcessingException(Exception arg1, Report report)
Warning 23:16:27.723574 #12 Assembly Microsoft.GeneratedCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null loaded more than once in void SharpCap.Program.CurrentDomainOnAssemblyLoad(object sender, AssemblyLoadEventArgs assemblyLoadEventArgs)+(string s, Assembly a) => { } [1]
Warning 23:16:27.855581 #12 No Pss snapshot functions, cannot capture thread state : Exception of type 'EntryPointNotFoundException' : Unable to find an entry point named 'PssFreeSnapshot' in DLL 'kernel32.dll'.
Stack Trace: at int SharpCap.UI.ThreadDumper.PssFreeSnapshot(IntPtr ProcessHandle, IntPtr SnapshotHandle)
at bool SharpCap.UI.ThreadDumper.CanCaptureSnapshots() in C:/Documents/Source Code/SharpCap/src/SharpCap/BugReporting/ThreadDumper.cs:line 107 in bool SharpCap.UI.ThreadDumper.CanCaptureSnapshots()
Info 23:16:30.062708 #12 Trying to stop capture cleanly before shutting down in void SharpCap.Models.Application.BeforeErrorShutdown()
Debug 23:16:30.066708 #1 Notification (Status=Error): SharpCap has encountered an error and is attempting to stop your capture before closing. in void SharpCap.UI.NotificationViewModel.DisplayMessage(NotificationMessage message)
Info 23:16:30.085709 #12 Stopping capture on MultiCaptureProvider in bool SharpCap.MultiCaptureProvider.StopCapture()
Info 23:16:30.085709 #12 Started bool SharpCap.Base.CaptureProviderBase<T>.StopCapture() in bool SharpCap.Base.CaptureProviderBase<T>.StopCapture()
Info 23:16:30.086709 #12 Capture Event : StoppingCapture in void SharpCap.MultiCaptureProvider.SendCaptureEvent(object sender, CaptureEventArgs e)
Debug 23:16:30.113711 #12 Status update after capture complete. in void SharpCap.Models.Camera.ImplOnCaptureEvent(object sender, CaptureEventArgs captureEventArgs)
Info 23:16:30.113711 #1 StoppingCapture event received in UI thread in async void SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(object sender, CaptureEventArgs e)
Debug 23:16:30.114711 #12 Started void SharpCap.Base.BaseImageProvider.BeforeStopCapture() in void SharpCap.Base.BaseImageProvider.BeforeStopCapture()
Info 23:19:00.818330 #1 UI Pane controls set to autohide : False in void SharpCap.New.DockingArea.ToolPane_OnPropertyChanged(object sender, PropertyChangedEventArgs e)
Info 23:19:00.868333 #1 UI Pane controls set to autohide : True in void SharpCap.New.DockingArea.ToolPane_OnPropertyChanged(object sender, PropertyChangedEventArgs e)
Info 23:20:23.127038 #1 Received shutdown request : None in bool SharpCap.ViewModels.SharpCapViewModel.HandleShutdownRequest(CloseReason eCloseReason)
Info 23:20:23.128038 #1 Main window closing. in bool SharpCap.ViewModels.SharpCapViewModel.HandleShutdownRequest(CloseReason eCloseReason)
Info 23:20:23.128038 #1 Received closing event, SharpCap shutting down in void SharpCap.New.MainWindow.MainWindow_OnClosing(object sender, CancelEventArgs e)
Debug 23:20:23.130038 #1 Started void SharpCap.New.MainWindow.Closedown() in void SharpCap.New.MainWindow.Closedown()
Info 23:20:23.147039 #1 Selecting transform in void SharpCap.Models.Transforms.set_SelectedTransform(ITransform value)
Info 23:20:23.168041 #1 Changing camera from Ares-M PRO (IMX533) to none in void SharpCap.Models.Application.SelectNewCamera(Camera value)
Info 23:20:24.202100 #1 Started bool SharpCap.Base.CaptureProviderBase<T>.StopCapture() in bool SharpCap.Base.CaptureProviderBase<T>.StopCapture()
Info 23:20:24.203100 #1 Capture Event : StoppingCapture in void SharpCap.MultiCaptureProvider.SendCaptureEvent(object sender, CaptureEventArgs e)
Info 23:20:24.204100 #1 StoppingCapture event received in UI thread in async void SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(object sender, CaptureEventArgs e)
Debug 23:20:24.205100 #1 Status update after capture complete. in void SharpCap.Models.Camera.ImplOnCaptureEvent(object sender, CaptureEventArgs captureEventArgs)
Debug 23:20:24.207100 #1 Started void SharpCap.Base.BaseImageProvider.BeforeStopCapture() in void SharpCap.Base.BaseImageProvider.BeforeStopCapture()
This BadImageFormatException error looks to me as if the 64bit program is trying to call a 32bit dll ?
Thank you for your help !
Crash when capturing images.
Forum rules
If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Please also read about Troubleshooting USB Issues before posting.
*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***
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]
If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Please also read about Troubleshooting USB Issues before posting.
*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***
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]
- admin
- Site Admin
- Posts: 17545
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Crash when capturing images.
Hi,
yes, one reason could be trying to use a 32 bit DLL in a 64 bit process, so it would be worth fully uninstalling then re-installing SharpCap to make sure all the right files are in place. From the place where it happens, it would most likely be SharpCap.StarDetector.dll that is failing to load.
It may also be worth trying the 32 bit version of SharpCap - you only have 4gb of memory as far as I can see (I found the uploaded bug report that matches this problem), so there is relatively little advantage in the 64 bit version.
Finally, one other possible thing that might cause this is the age of your CPU. SharpCap requires a minimum of SSE4 to be supported by the CPU, which limits compatibility with very old CPUs. As far as I can see, your CPU should support SSE4.1 and 4.2, so should be OK, but it comes from pretty much the earliest supported generations of CPU, so maybe there is an oddity in some of the instructions used by SharpCap. I've seen similar failures to load this DLL on old CPUs, sometimes the 32 bit version can cope better here too.
I did see from the uploaded crash report that you tried to use the /dump command line flag to get further crash diagnostics. Unfortunately the 64 bit version doesn't support that flag (there is no 64 bit version of the DLL that enables it to work), but you *can* capture crashdumps of the 64 bit version using SysInternals procdump (https://learn.microsoft.com/en-us/sysin ... s/procdump). Instructions on how to use it can be found here : viewtopic.php?p=39396#p39396
cheers
Robin
yes, one reason could be trying to use a 32 bit DLL in a 64 bit process, so it would be worth fully uninstalling then re-installing SharpCap to make sure all the right files are in place. From the place where it happens, it would most likely be SharpCap.StarDetector.dll that is failing to load.
It may also be worth trying the 32 bit version of SharpCap - you only have 4gb of memory as far as I can see (I found the uploaded bug report that matches this problem), so there is relatively little advantage in the 64 bit version.
Finally, one other possible thing that might cause this is the age of your CPU. SharpCap requires a minimum of SSE4 to be supported by the CPU, which limits compatibility with very old CPUs. As far as I can see, your CPU should support SSE4.1 and 4.2, so should be OK, but it comes from pretty much the earliest supported generations of CPU, so maybe there is an oddity in some of the instructions used by SharpCap. I've seen similar failures to load this DLL on old CPUs, sometimes the 32 bit version can cope better here too.
I did see from the uploaded crash report that you tried to use the /dump command line flag to get further crash diagnostics. Unfortunately the 64 bit version doesn't support that flag (there is no 64 bit version of the DLL that enables it to work), but you *can* capture crashdumps of the 64 bit version using SysInternals procdump (https://learn.microsoft.com/en-us/sysin ... s/procdump). Instructions on how to use it can be found here : viewtopic.php?p=39396#p39396
cheers
Robin
Re: Crash when capturing images.
Dear admin,
Thank you for your reply.
I do have 8 gigs of ram. I removed one of the sticks a some point because of an error (4 beeps) when starting the computer. It was finally some dust that prevented full contact in slot #2.
I already fully uninstalled and reinstalled SharpCap.
I uninstalled and reinstalled .NET framework 4.8.
Unfortunately these operations didn't solve the issue.
I ended up downgrading to version 4.0, which works very well, except for the new features that were not available anymore (camera cooling).
I will try V4.1 32bit version.
I frequently use sysinternals. I will do a dump for you if you wish.
Yes my astro computers are old, most over 10 to 12 years old, but they do the job well, and I don't need to invest in some new equipment yet.
I use a stock of spare pc's from my company that they had just thrown away since their computer security department decided to renew the complete park to Windows 11.
All of them are good for astro use and even more.
Thank you.
Best regards
Axel
Thank you for your reply.
I do have 8 gigs of ram. I removed one of the sticks a some point because of an error (4 beeps) when starting the computer. It was finally some dust that prevented full contact in slot #2.
I already fully uninstalled and reinstalled SharpCap.
I uninstalled and reinstalled .NET framework 4.8.
Unfortunately these operations didn't solve the issue.
I ended up downgrading to version 4.0, which works very well, except for the new features that were not available anymore (camera cooling).
I will try V4.1 32bit version.
I frequently use sysinternals. I will do a dump for you if you wish.
Yes my astro computers are old, most over 10 to 12 years old, but they do the job well, and I don't need to invest in some new equipment yet.
I use a stock of spare pc's from my company that they had just thrown away since their computer security department decided to renew the complete park to Windows 11.
All of them are good for astro use and even more.
Thank you.
Best regards
Axel
- admin
- Site Admin
- Posts: 17545
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Crash when capturing images.
Hi Axel,
I will happily have a look at crash dumps if you manage to grab any - this error is a bit of a mystery to me, since it doesn't quite fit the pattern for anything I've seen before, so it would be nice to track down the cause. The dump files will most likely be too large to upload here, but there is a 'Contact Us' link at the bottom of the forum pages that you can use to email through the files.
thanks,
Robin
I will happily have a look at crash dumps if you manage to grab any - this error is a bit of a mystery to me, since it doesn't quite fit the pattern for anything I've seen before, so it would be nice to track down the cause. The dump files will most likely be too large to upload here, but there is a 'Contact Us' link at the bottom of the forum pages that you can use to email through the files.
thanks,
Robin