Samsung S7 Camera flickering

It looks like data corruption somewhere. If you have an SDXC card have you tried setting the camera app to save to SD card for comparison?
You could also try a third party camera app to see if that creates the same type of corruption. For instance side-load the camera app Google uses on their Pixel devices, you can download it at XDA-developers (scroll down to How to Get the Google Camera on Any Phone):
https://www.xda-developers.com/get-pixel-2-features-android/

If those two doesn't fix it, try doing a hard reset from the phone's boot menu, make sure to choose the option called 'wipe data/factory reset; to try and get rid of any corrupted data. This will erase everything on your phone, so make sure to save anything you want to keep. Maybe write down which apps you have and such. Backup emails and documents.... To enter the boot menu first power off your phone then press and hold the Home button, Volume Up and the Power Button simultaneously until you get to a blue screen most likely saying something like "No command". Wait there and after a few seconds you'll be presented with a menu of Android recovery option. You browse the options with the volume rocker (up and down for up and down) and you select an option by tapping the power button after you've highlighted it. First choose the option called Wipe Cache Partition. This will erase any cached system settings Android/Samsung/devs has applied. When that's done choose the menu option called Wipe Data/Factory Reset to erase everything and automatically re-install the factory image.

If your camera is still acting up after this I guess you get the joys of contacting the seller about a repair/replacement.
 
There is one simpler/earlier troubleshooting step I probably should have mentioned :)
You can try clearing the camera app's cache. To do that, enter the Settings on your phone, scroll down to Apps and then find Camera in that apps list. There you'll see a few system stats and settings for the Camera app. To clear its cache, tap or Storage (where its current used amount of storage is shown) and tap both clear data and clear cache. Reboot the phone to see if Samsung wants to download any updates and then try the camera again.