Several videos of people berating and taunting our police officers have recently appeared on social media. For the public, viewing this ignorant spite might come as a shock. But for cops, witnessing this boorish behavior is, sadly, nothing new.

Like police across our nation, New York City cops regularly experience scenes like these. Overwhelmingly, our officers handle the situations with professionalism, discretion, and a stoicism that refuses to stoop to the camera-person’s level of base crassness.

Only a small percentage of people act out against the police like this. And I am positive that a majority of New Yorkers find the videos as unacceptable as I do. What these videos do show, however, is exactly what cops can, and do, routinely face.

For anyone to characterize such low-class behavior as a reaction to some fictional “hands-off” police policy is utter nonsense. Maliciously sowing seeds of dissent and doubt makes our hardworking officers less safe. And that, I simply will not condone.

As cops, we have to have thick skin. In three recent episodes — in The Bronx, where police walked away from a few loudmouths jeering them; in Brooklyn, where an officer issued a summons for disorderly conduct to a man irate about being asked questions about a local crime; in Manhattan, where a sergeant ordered a man videotaping inside a precinct to leave the premises — the cops did the right thing, legally and professionally.

Another thing that is true: NYPD officers know how to do their jobs with expertise and commitment to the public good. Let no one confuse smart, effective policing that trusts and empowers our cops with some silly, false notion of “standing down.” That does an enormous disservice to all New Yorkers.

The proof is clear as day: the increasing number of illegal guns our officers take off the streets each day; the heroic rescues they frequently perform; and the investigations we and our law enforcement partners jointly carry out that target society’s worst criminals — and push violence and disorder down past already record-low levels.

I talk with police officers all the time, and I speak with every fresh class of sergeants, lieutenants and captains as they prepare for their new roles. I tell each to be proud of their decision to make a difference, to live a life of significance. And I remind them to never forget who they are, and what they do. They are cops. And what they do matters.

I tell them we trust them to make split-second, potentially life-altering decisions. We trust them to do a very tough, very important job. We trust them to be creative problem-solvers and use discretion when they can, but to take enforcement action when appropriate. We can never let the background noise distract us from our vital mission of keeping this city safe.

NYPD cops answer about four-and-a-half million radio runs a year, and are flagged down countless other times. These vile videos tell the people we serve what our 36,000 uniformed members already know: The civility of society balances on a knife’s edge. And cops are the ones who made the selfless decision to help maintain that balance.

All of the freedoms our government exists to protect — freedom of worship, freedom of assembly, freedom of speech (including the hateful speech on the videos) — rely on a foundation of public safety. That is why violence against the police, verbal or otherwise, is a dishonor to civilized society.

We know that not everybody loves the police. And we do not shy from criticism, because we know it goes hand-in-hand with the possibility of saving lives. People need us, and we need every New Yorker. We all want our neighborhoods to be safer places for our families, our neighbors and ourselves.

I could not be more proud of our cops. They do what they do better than anyone else, anywhere. And, as a result, our great city is safer today than anytime in three generations.

So, to the men and women of the NYPD who bravely put on that uniform every day — and it does take courage — thank you for your dedication, your leadership, and your powerful example to the rest of New York City and our nation.

James O’Neill is police commissioner of New York City.