If you are a S4 user and if at some time you receive a "Warning. Camera Failed" message don't worry too much. This is not such a big issue. It's a software problem that can be solved. So what can you do?
1. Clear camera cache and data.
To clear camera cache go to Settings and then Application Manager. Tap on the camera icon and then tap the force close button, then the clear cache button and the clear data button. After this, restart your device. Note that all your preferences could be lost in the process. By taking this process, you clear all camera cache for the data , that some can be corrupted. This process will affect only the camera app.
2. Factory reset.
If the first process doesn't work, then you should change the tactics. Backup all your important files and go to Settings. Choose Accounts tab and tap reset then tap factory data reset. Next tap delete all. This process will delete almost all the data on the device, that's why is important to make backups.
3. Wipe cache partition.
The ultimate process is to wipe cache partition. To do so, turn off your phone. After this, hold simultaneous volume up, home and power buttons until the device starts to vibrate. Then let go the power button, but still press the other two. This should open Android System recovery. Press volume down to choose "wipe cache partition" and then press the power button. This solution hopefully will solve all your problems.