Exception in Worker Thread for TimeLapse

I have had to disable TimeLapse due to the following issue:

This will fill the log file up, and if logging is disabled it will eventually cause the windows service to halt.

I recognise this “Object reference not set to an instance of an object”. It comes from an update of Windows. Sometimes this have been solve by:
-stop NCS
-go to C:\Users%username%\AppData\Local\Moonware and delete all.
-go to C:\Users%username%\AppData\Roaming\Moonware and delete all.
-start NCS

-Henrik

Here is what I did:

  1. Open an elevated command prompt on the server running NCS

  2. Entered the following commands:

    sc queryex NetcamStudioSvc64
    

Noted the PID that NCS was running under

   net stop NetcamStudioSvc64

Received the following status message:

   The Netcam Studio Server (64-bit) service is stopping........
   The Netcam Studio Server (64-bit) service could not be stopped.

Continued with these commands:

   taskkill /PID [pid from queryex] /F
   rmdir -r "C:\Users\%USERPROFILE%\AppData\Local\Moonware_Studios"
   rmdir -r "C:\Users\%USERPROFILE%\AppData\Roaming\Moonware"
   net start NetcamStudioSvc64

I have enabled TimeLapse for all sources and am monitoring the event log. So far, after 15 minutes, no issues reported.

Same issue has occured again:

Disabling TimeLapse fixed this:

Can we get a software update for this, please?

Since it has been working before so what changed?

The only change was an update to the windows defender virus definitions. This required no reboot to the server.

Here’s what I just tried:

  1. Updated the operating system
  2. Disabled windows updates
  3. Uninstalled NCS
  4. Cleared NCS AppData folders
  5. Installed NCS
  6. Configured NCS
  7. For all video sources:
    7.1. Enabled motion detection and set detection zones
    7.2. Enabled timelapse every 20 seconds for a still image
  8. Let NCS run for two days

The following was observed:

  1. The event log is filled with exceptions:
  2. The camera feeds lock up - in this example from today, some feeds stopped yesterday at 10:59, some at 13:35. One test feed was left with no timelapse or record, and has continued to work.

I am disabling the timelapse once again, but this is an issue for two reasons:

  1. Timelapse isn’t working
  2. Timelapse is useful for keeping camera feeds active and live

How can I best raise a ticket or issue for this?

Thanks, now I have a configuration to test.

Hi,
I have been running this for 59h now and so far no errors. 6 cams (2 x rtsp and 4 x mjpeg) all in motion detection and with Timelapse enabled and set to 20 sec. for still images. No errors.

There is another component that you might test to update. On the download page Netcam Studio - Network Camera Surveillance Software there are prerequisites. Install Visual C++ Redistributables (x64) from https://aka.ms/vs/16/release/vc_redist.x64.exe again.
-Henrik

I started a PowerShell console with Admin priviledges and did the following:

PS C:\Windows\system32> Get-Service NetcamStudioSvc64

Status   Name               DisplayName
------   ----               -----------
Running  NetcamStudioSvc64  Netcam Studio Server (64-bit)


PS C:\Windows\system32> Stop-Service NetcamStudioSvc64
WARNING: Waiting for service 'Netcam Studio Server (64-bit) (NetcamStudioSvc64)' to stop...
[note: this continued for a long time and I had to cancel the attempt]
WARNING: Waiting for service 'Netcam Studio Server (64-bit) (NetcamStudioSvc64)' to stop...


PS C:\Windows\system32> Get-Service NetcamStudioSvc64

Status   Name               DisplayName
------   ----               -----------
StopP... NetcamStudioSvc64  Netcam Studio Server (64-bit)


PS C:\Windows\system32> Get-WmiObject -Class win32_service | Where-Object {$_.state -eq 'stop pending'}


ExitCode  : 0
Name      : NetcamStudioSvc64
ProcessId : 6164
StartMode : Auto
State     : Stop Pending
Status    : Degraded


PS C:\Windows\system32> taskkill /PID 6164 /F
SUCCESS: The process with PID 6164 has been terminated.


PS C:\Windows\system32> Get-Service NetcamStudioSvc64

Status   Name               DisplayName
------   ----               -----------
Stopped  NetcamStudioSvc64  Netcam Studio Server (64-bit)


PS C:\Windows\system32> & 'C:\Users\filesvc\Downloads\VC_redist.x64(1).exe'
[note: this launched the VC++ installer, and "remove" was selected]


PS C:\Windows\system32> & 'C:\Users\filesvc\Downloads\VC_redist.x64(1).exe'
[note: this launched the VC++ installer, and "install" was selected]



PS C:\Windows\system32> Start-Service NetcamStudioSvc64
WARNING: Waiting for service 'Netcam Studio Server (64-bit) (NetcamStudioSvc64)' to start...
WARNING: Waiting for service 'Netcam Studio Server (64-bit) (NetcamStudioSvc64)' to start...

I will continue testing and monitoring.

After running for a few hours with TimeLapse enabled in the scheduler, the same thing is occurring:

Any other ideas or suggestions?

I assume you installed Visual C++.
Test to not use the scheduler. Just enable Timelaps for one camera and let i run.
Uninstall the latest Windows update for NET framework. Run NCS. If working do a Windows Update.

I uninstalled and reinstalled the Visual C++ Redistributable.

I have enabled motion detection and timelapse for all camera sources, e.g.:

But not set timelapse on all camera sources schedule, e.g.:

There are no Windows Updates for .NET Framework. The server feature for .NET Framework 4.8 is installed:

Currently no Windows Updates pending.

You are running Windows Server OS. Have you read this Running Netcam Studio on Windows Server OS
Have this been working before or is it a new installation?

I have read and previously followed the NCS on Windows Server post.

This has been running since March 2022.

As previously noted, several cameras have frozen after not being “kept alive” by the use of Timelapse - the event log is filled with such messages:

I really need timelapse to be active. Any idea on how we can raise this as an issue?

What server OS are you running NCS on?

This installation is running on Windows Server 2022 Standard with Desktop Experience.

I am running server 2022 with same camera setup and config as earlier.
There is a new update of net framework 3.5 and 4.8 that you can see in update history and consider to uninstall for test.

– Have been running Win Server 2022 standard build 20348.681 for about 48h with same config as earlier and cams in motion detection and with a 20 sec. Timelapse. So far no errors.