I will say what I always say when these things happen. When the police pull you over, if they tell you to step out of your car and order you to do the Hokey Pokey, put your right foot in, take it out, and shake it all about.
If they are out of line, get it straightened out with a lawyer in court. But if you resist, now you open yourself up to getting beaten. Comply and your chances of getting hurt are almost zero.
I seriously doubt these officers decided to beat the man for kicks.
If you comply and take a beating, I'm unequivocally on your side. If you resist and take a beating, the entire thing was in your hands and you chose wrong. My sympathy for you in that situation is minimal.