The first command uses HEVC hardware plugin, the second uses software plugin. I just ran the same commands as yours in a I7-4770 system, didn't see your problem. Does your system have the latest driver? When did the second command stop? Did it finish full video? Thanks.
I ran the same command with the SW plugin for many loops of video, couldn't reproduce the problem. Were you using the latest Samples? Can you provide the output from the system analyzer at MediaServerStudioInstallationDirectory/Software Development kit/tools/mediasdk_sys_analyzer? Can you upload your input file too? Thanks!
I just reproduced your error with an evaluation version installed. For evaluation edition, there is limitation for maximum number of frames supported. In this case, it is 1000 frames. Sorry for taking so long to find out and didn't confirm it earlier. Thanks!