For the decision of problem with the stop of record and hanging up of server I wrote bat-file, which stops and starts DVR and cause it from the Task Scheduler.
taskkill /IM encode.exe
ping 127.0.0.1 -n 10 > nul
c:\dvr\dvr.exe
But it would be desirable to know how to decide this problem without perversions.