The police are public officials. They work for the public. It should be illegal to record a cop off duty, but on duty, they work for us and their actions are public actions, as they act in the interest of the public.
So this guy had a right to record the officer and put him on YouTube.