Camp had made 60 appearances in all competitions for the Millers since joining the club in 2015, but he has now secured a reunion with Neil Warnock, whom he played under when the Bluebirds boss was at the New York Stadium.
The 32-year-old told the club's official website: "I'm really pleased to have signed for Cardiff City. The manager has always been fantastic with me and I'm delighted to work with him again.
"Having worked with him previously too, I've already got a really good relationship with Andy Dibble (Cardiff goalkeeping coach). He knows how to get the best out of me and we bounce off one another.
"I'm looking forward to playing in front of the Cardiff City supporters."