Update on my project:
I was able to get the JPEG image from the stream of the esp32 using the Glide library. I did not touch the esp32 because the program provided by M5Stack on it works just fine. I am now able to provide the android app a bitmap and a PNG file for saving on the android phone and further operations like I mentioned in my first post.
Thank you for your help @Net-time. For other people who might be interested in the project I want to answer your questions:
The app will be running on the android phone and no other device besides the esp32 and the camera is needed.
The app will be started manually. If I am able to implement it it will be showing an error message if the car speed (measured by the GPS of the phone) is above a given speed.
The settings should not be hardcoded because every single smartphone has a different performance of the CPU. Therefor some can handle larger images and some not. The fps should not be below 10 or 15 fps so the user has to have the chance to select the image quality.
I would like to have an android app for this project because it is way easier to click on an app icon, then open the web browser and do all things manually. In addition to that i can add sensor values or other things on the screen when other students provide me the information via Bluetooth. Opening an app with a browser plugin slows the whole process down and do not look good for the user.
My only problem for now is to send the settings the user wants to the esp32. But this is more of an android programming issue.