Here’s the deal: as a resident of the US, you have the right to record the police in the course of their public duties. The police don’t have a right to stop you as long as you’re not interfering with their work. They also don’t have a right to confiscate your phone or camera, or delete its contents, just because you were recording them.
Despite some state laws that make it illegal to record others without their consent, federal courts have held consistently that citizens have a First Amendment right to record the police as they perform their official duties in public. The Supreme Court also recently affirmed that the Fourth Amendment, protecting citizens from arbitrary searches and seizures, means that cops need to “get a warrant” if they want to take your cellphone.