How to detect unavailable camera stream?

Hi,
I have turned an old Android phone into an indoor camera with the Android IP Webcam integration. This camera is turned on only when I leave home and it turns off when I return, using an automation and Tasker on my phone. Overall, it works well, but sometimes, the camera stream is unavailable as shown here:
Sans titre

That’s definitely an issue with my Android device, but it can very easily be fixed by turning off and on again the camera. So I could make an automation to cycle the camera, but the problem is I can’'t find any method to detect the unavailable image …
The attributes of the camera are always the same when it’s either on or off but without video stream…
Any idea how to detect the unavailable image ?
Thanks !

Did you manage to solve this, I have exactly the same problem trying to find something to indicate the stream is down.
M

No unfortunately, I haven’t…
If you have energy to investigate, I’d be glad to hear about your solution!