In case someone is interested, I updated the video recording script with preview from my previous post, it is now possible to preview the video without delay while recording thanks to v4l2loopback which allows accessing a camera from several applications at the same time.
I noticed that after recording around 2 minutes with preview, the phone crashed but I was able to fix the issue and record more than 5 minutes with preview by lowering the FPS to 20 (which may appear as around 15 FPS with the variable framerate ffmpeg parameter "-fps_mode vfr" to avoid duplicated frames) but the video should be smooth enough.
I noticed that after recording around 2 minutes with preview, the phone crashed but I was able to fix the issue and record more than 5 minutes with preview by lowering the FPS to 20 (which may appear as around 15 FPS with the variable framerate ffmpeg parameter "-fps_mode vfr" to avoid duplicated frames) but the video should be smooth enough.