If you can't fix "Camera failed" by Hard / Factory reset, upgrade or change firmware, you must to replace rear facing camera module. This part you can find easy on eBay.
Video tutorial:
--------------------------------------
Samsung GALAXY S4 / I9500 - Main camera replacement - YouTube...