Hi ibrar111,
Thank you for posting to Apple Support Communities.
With the issues you're experiencing, you can follow the guidance here to help resolve issues with the iPhone freezing and not responding while recording videos. Here's how:
1. Remove any case, accessory, or film that might block the camera or that places a magnet near the camera.
2. Test the camera by trying to take a photo.
3. If the photo is blurry, clean the front and back camera lenses with a microfiber cloth. If you see dirt or debris inside the lens or if the camera lens appears to be misaligned or blocked, contact Apple Support for help with your iPhone, iPad, or iPod touch.
4. Restart your iPhone, iPad, or iPod touch.
5. Test the camera again by taking a photo. If your device has a front and rear camera, check if one or both isn’t working. To switch cameras, tap the rotate button
.
This information is provided in If the camera or flash on your iPhone, iPad, or iPod touch isn't working - Apple Support
If those steps don’t help, take a look at the storage on your iPhone and follow the guidance provided here: About iOS or iPadOS performance on your iPhone, iPad, or iPod touch - Apple Support
Let us know if you need more help.
Take care.