Not an answer to your software question, but you will very likely struggle with overheating since your phone will almost necessarily be in direct sunlight for hours at a time. If you really need to do this, avoid mounting your phone with a case and try to use a mount that does not cover too much of your phone's rear surface- cases and mounts can make it harder for your phone to dissipate heat.
I used autoboy for a hot minute when i wanted to run something on my phone to let it act like a psuedo dashcam before I got my android touchscreen unit and hooked up a rear cam and dash cam to it. Not sure if there’s anything better or more recent since I’ve been on Apple since my Pixel 3 XL.
Def make sure you keep cooling in mind. I was kucky that my vents were towards the top of the dash so having a vent-mounted magnetic mount worked in my favor, keep the AC on during the summer, shut the vent off during Winter.