CINCINNATI — For the third time in a week, the trial of a police officer in the fatal shooting of a black man has ended without a conviction, the latest setback for prosecutors and activists seeking greater accountability for the use of deadly force by the police.

On Friday, a judge found that the jury was hopelessly deadlocked in the retrial of Raymond M. Tensing, the former University of Cincinnati police officer who fatally shot Samuel DuBose, an unarmed motorist, in 2015. The judge, Leslie Ghizfter, declared a mistrial after earlier on Friday urging jurors to keep deliberating. Mr. Tensing’s first trial last fall also ended with a hung jury.

When the Hamilton County prosecutor, Joseph T. Deters, first charged Mr. Tensing with murder and involuntary manslaughter in July 2015, he suggested a path to a conviction would be much easier than this, calling it the most “asinine” police shooting he had ever seen.

But its rocky course in court, after two mistrials, underscores a difficult reality for those who want police officers held criminally liable in cases like these: A conviction is far from assured, even when there is video evidence and an aggressive prosecutor.

Mr. DuBose’s death joined a grim toll of high-profile deaths of black people at the hands of police officers, including Michael Brown in Ferguson, Mo., Freddie Gray in Baltimore and Walter Scott in South Carolina, that fueled a wrenching national debate over race, policing and the use of force.

The shooting, a few blocks from the university campus, was also among the fast-growing list of violent encounters captured on video — in this case by a body camera worn by Mr. Tensing.

In Mr. Tensing’s trial, prosecutors pointed to video evidence time and again to suggest that he shot Mr. DuBose during the traffic stop even though Mr. DuBose had not put him in danger. But the defense lawyers contended that video analysis created “20/20 hindsight” that Mr. Tensing did not have in the moment, and contended his shooting was justified because he believed, in the moment, that he was going to be dragged by Mr. DuBose’s car.

The verdict follows three others in the last week that sided with police officers. On Wednesday, a Milwaukee officer, Dominique Heaggan-Brown, was cleared of wrongdoing in the death of Sylville K. Smith, after Mr. Smith ran from the police. Last week, a jury in St. Paul acquitted Officer Jeronimo Yanez of criminal charges in the shooting death of Philando Castile, a case that drew national attention when Mr. Castile’s girlfriend live-streamed the aftermath.

And last month, jurors in Tulsa, Okla., acquitted Officer Betty Jo Shelby of manslaughter in the fatal shooting of Terence Crutcher, an unarmed black man.

Because of heavy pretrial publicity, both sides asked that Mr. Tensing’s case be moved elsewhere, but Judge Ghiz refused, keeping the trial in Common Pleas Court in Cincinnati. Civic leaders had eyed the case warily, knowing that when a white officer shot an unarmed black man there in 2001, rioting followed.

Mr. DuBose, 43, was driving his fiancée’s 1998 Honda Accord when Mr. Tensing, then 25, pulled him over after seeing a missing license plate. When Mr. DuBose could not produce a driver’s license, the officer told him to remove his seatbelt and began to open the driver’s door.

From there, things escalated with frightening speed. In the span of less than four seconds, Mr. DuBose pulled the door closed with his left hand and restarted the car with his right hand; Mr. Tensing reached into the car with his left arm, yelled “Stop!” twice and with his right hand fired his gun once, hitting the driver in the head.

The case seemed likely to turn on what jurors believed was going through Mr. Tensing’s mind in those seconds.

“The evidence shows there was no danger to Ray Tensing when he made the decision to go for his gun,” a prosecutor, Seth Tieger, said in his closing statement on Monday. The prosecutor said, “Sam DuBose was trapped in that car during that stop, and he was an easy target when his car became his coffin.”

Mr. Tensing’s lawyers contended that the officer had believed he going to be dragged by the car and had acted “instinctively.”

“We are talking about 2.83 seconds of action on that video that have led us all to be here for all this time,” Stew Mathews, a defense lawyer, told the jury. “You have to try to put yourself into the position of an officer on the scene of a situation like this and ask yourselves, ‘What would I do?’”

The video contradicted Mr. Tensing’s initial claim that his arm had been caught in the steering wheel. The images show him reaching toward the ignition, as if to turn off the car, then toward Mr. DuBose.

Under cross-examination, Mr. Tensing testified, “I just misperceived that my arm was caught in the steering wheel.”

Officers are trained not to reach into a vehicle in such a situation, and Mr. Mathews conceded in his closing argument that his client had “made a tactical error.”

Mr. Tensing testified that the car began to move and drag him, and he feared for his life. His goal was not to kill, he said, but “to stop the threat.”

Grant Fredericks, a video analysis expert who usually testifies on officers’ behalf, testified for the prosecution. Breaking down the images frame by frame, he said that the car had moved little or not at all before the officer fired. Mr. Tensing was not stuck, the witness said, and he was not being dragged.

But prosecutors suffered a serious setback when a Cincinnati police sergeant who investigated the shooting testified that she believed it “may have been determined to be justified.”

Prosecutors have long been reluctant to put officers on trial. Appeals courts have ruled that officers’ split-second judgments should be given deference, and juries and judges have often give officers the benefit of the doubt.

The proliferation of video has increased the pressure to prosecute, but even in high-profile recorded killings like those of Eric Garner on Staten Island, and Tamir Rice in Cleveland, no charges were filed.

When prosecutors do bring charges, the results are mixed. A jury could not agree on a verdict on the officer who shot Walter L. Scott in the back as he ran away in North Charleston, S.C.; and just this month, an officer was acquitted in the shooting of Philando Castile during a traffic stop in a St. Paul suburb.

Mr. Tensing was the first officer charged in a shooting in Cincinnati since the 2001 incident — a case that led to an acquittal. And Mr. Deters has said that Mr. Tensing was the first officer the prosecutor’s office had ever charged with murder on the job.