If you are standing in a public area, you can film whatever you want. Just dont literally stand in their way while they are trying to work, its not just illegal, its rude.
Some cops hate being filmed, I personally dont care so long as you keep a safe distance and allow me to do my job.
If you are on federal property though there is a law against any kind of recording and picture taking, federal cops WILL cite or book you on it so..... fair warning.
whats a federal cop? you mean an agent?
All federal agencies have a police service assigned:
IRS police
Veterans Affairs Police
Secret Service Uniformed Police
Federal Reserve Police
US Capital Police
FBI Uniformed Police (Diff than Agent)
The list goes on and on....
They will cite or book you for recording on federally owned or controlled property.