Assuming you already checked the port for damage, there are filters above the HDMI port that can go bad over time, if you have any soldering skills I'd tear it down and check those first. If they all test fine, could be HDMI encoder dying as well.
If you don't have the skills, check around your area for repair shops that do soldering, they'll have seen this plenty of times and should be able to fix it for around $100-$150 or so