If you use
Do While True
It will never stop, so you have to close it manually to finish the "capture".