Sorry to hear about your near miss experience, it happens to us all sooner or later, although the careless and thrill seekers among us will experience these more of often than others. A camera might be helpful in the aftermath of an accident, but it won't keep you safe. Perversely it may even encourage you to take more risks, as you feel that you will have evidence of the wrong doing of others, rather than take a more defensive approach to cycling. You see this time and again on the web footage on youtube. That said, cams don't turn us all into jackass thrill seekers and risk takers, you weight it up, personally, cycling for me is a convenient form of transport, if I make it more difficult by having to maintain another gadget, I may just pack it in. Who needs one more thing to attach and recharge. I'll echo what others have said, it's better to be alive, than righteous and dead.
Just remember that we have lots of near misses in life, and not just on the bike. Most of your near messes might go right over your head. All it takes is a misplaced step at the top of a flight of stairs, would you sell up and get a bungalow? A lorry driver having a micro sleep in their cab, would you stop driving? What if you slipped climbing in or out of the bath, would you stop washing? We all want to control and mitigate risk where possible, but it has to be kept in check with the actual risk of death or serious injury accruing in any given day. I would encourage you not to give up on commuting, but instead use your experience as an opportunity to reflect on what you might do differently next time.
This is not to say this is your fault in any way, but scrubbing off a little speed when there are cars parked on the side of the road is probably a good idea if it means you can stop sooner. Look into the energy differences of travelling at 20mph vs 15, then 15 vs 10. It's quite illuminating. Zipping downhill on a quiet and straight rural wide road vs a bendy narrow urban road require different riding styles, throw in a wealth of unexpected urban hazards and idiots in cars and you've got a whole new kettle of fish. Personally my first near miss experience was going UPHILL and at some pace, I nearly went over my handlebars when a box van pulled out of a junction without warning, me almost going under the front. Not pleasant, but lessons learned. I ride much more conservatively nowadays, half expecting some moron to pull into or out of a junction as I'm passing at any moment.
In fact, moments before writing this I nipped to the bank to close my Help to Buy ISA and a taxi driver pulled out at a mini roundabout I pass every day. It's happened to me many times before in the same spot. I expect it. I ride accordingly. I stopped in a controlled and safe manner. Sure, the taxi driver was on the receiving end of some strong words, but fortunately he didn't have his day ruined with a death on his conscience. I would have the right to barrel through at 20mph if I wanted to, I had right of way, but it wouldn't have done me any favours. Learning a defensive riding style so important.