Turns out the issue for me was the taskkill lines after the capture Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel It was a bit too eager and it was killing the ffmpeg before it could complete the capture file cleanly. I simply commented them out and it had no problem doing the remaining tables. The program closes itself under normal circumstances anyways. Another option might be to increase the sleep, 5000 to say sleep, 10000. I also added a Beep at the end of each table capture so I can hear it working away :-) soundbeep, 1000, 700