Webcam-Livestream goes black after some minutes (randomly without any Error)

I need Qt for a GUI. The code is too large because of many things happen in background (not part of Livestream…)
When I use the build in windows app there is no black screen problem! IS there a way to restart the stream?