Quite on the contrary: I would never trust software alone (ML or not: n o n e) over such long time. If your cam gets stuck for whatever reason you are lost.
Proper engineering uses something called "Watchdog timer". You will find them in industrial designs (earth and space), esp. in non-maintainable environments.
Arduino, Raspberry (and others) do contain watchdogs.