Regarding the camera, I think you need to honestly evaluate how much you'll use it. Photo comparisons are easy to put together for the review sites and they draw a lot of interest and commentary but when you actually use the phone you won't be comparing your photos to anything. I've been intending to spend more time with the camera to figure out for myself how to use it best but the reality for me is that I just don't take many photos so I haven't even explored this much. I hardly ever use the camera but I use the speakers and the headphone out jack for hours each day. But audio doesn't lend itself to comparison tests on these review sites the way photos do. Have you seen Anandtech's comparison between the M8 and the Galaxy S5 for audio?
AnandTech | Smartphone Audio Testing - HTC One M8 and Samsung Galaxy S5
The M8 obliterates the S5 if you look at the data, and I can attest that you can definitely hear a major difference between the two using good headphones, but it took months for this to be published. Only GSM Arena does anything like that and their results were similar. I wonder if people overvalue the performance of smartphone cameras and undervalue audio performance relative to their actual usage. So far the camera has done a good job for me based on my needs. Camscanner files look crisp. Photos have been good if not amazing. HDR shots have looked especially good. Friends have enjoyed seeing the various effects and I've even used the U-Focus to create a substantially improved photo or two. I'm not worried about bragging rights; the camera is good enough. And most phone cameras have their weaknesses. For example, Pocketnow just put up some video from an LG G3 that is quite underwhelming. If you're like me you have a small point-and-shoot camera for vacations and other important occasions that is better than any of the current phone cameras anyway so this may not be such an important issue for you in practice.
Regarding the battery, look at the second table here:
How to Prolong Lithium-based Batteries - Battery University
Battery life is excellent for me so I seldom go below 40% before charging. At that rate my phone should be able to go through around 1000 charge/discharge cycles before falling to 70% of original capacity, which would still be pretty good. At that point I'll almost certainly be ready to upgrade as two years will surely have passed by then. I bought an external battery supply when I bought the M8 to allay my concerns about the battery and after a month I haven't had to use it even once.
In the abstract it can be hard to weigh your priorities and make a decision. The other flagships are really nice devices. But the everyday goodness of the phone – especially with respect to those speakers playing my podcasts and audiobooks around the house, the great sound through the earphones in the car, the amazing speed and responsiveness of the phone, and the general beauty and quality feel of the device – keeps me from wishing I had something else. Just thinking about the tinny, shrill little speakers of other phones is enough to keep the honeymoon going for me.