PARK CITY, UTAH — For his documentary “The Force,” Oakland filmmaker Peter Nicks had set out simply to “examine the relationship” between the Oakland Police Department and the community it serves.

What he couldn’t know is that the time frame he chose — 2014 to 2016 — would turn out to be such a volatile stretch for the overburdened agency with a tangled history of problems that have fueled public distrust and led to federal oversight.

“We began the project before Black Lives Matter was a hashtag,” said Nicks in a Park City interview the day before his film’s world premiere Jan. 22 at the Sundance Film Festival.

As it turned out, 2014 was the year the streets of Ferguson, Missouri, exploded after a white officer shot an unarmed African-American suspect. In the months that followed, the Black Lives Matter movement emerged as more reports of police abuse came to light, and protests erupted in other cities, including Oakland.

“Instead of following these cops around and trying to understand who becomes a cop and why, which was the central question of the initial concept of the film,” he said, “we were shooting three months of protests.”

Then in 2016, a shocking sex scandal involving an underage sex worker and officers from various departments sent OPD into a tailspin, with then-police Chief Sean Whent, who is featured prominently in the film and considered a reformer, eventually resigning. (Whent was not involved with the exploited teenager).

The events demanded Nicks to be nimble.

In fact, filming had already wrapped when news of the scandal broke, prompting him to pick up his camera again and forfeit a coveted Sundance Institute Lab editing spot.

“We had to turn them down because (crap) hit the fan and we have to cover this,” Nicks said. “It was a really hard decision, but it was the right decision.“

“The Force” is the second in a trilogy of Oakland-set documentaries Nicks launched with 2012’s “The Waiting Room,” which took a fly-on-the-wall look inside Highland Hospital’s resource-strapped emergency room. His next documentary concentrates on education.

Why Oakland?

“(It’s) a city that faces local issues that reflect national concerns,” he says. “We talk about access to health care, the criminal justice system, education, city government. All these things resonate, particularly in a place like Oakland that has such a vibrant activist community and is such a diverse community with different interests that are ripe for exploration.”

As a documentarian, his primary concern with “The Force” was to portray everyone fairly.

“It was important to me going in not to demonize the police, not to demonize the community, not to demonize the protesters, not to demonize Black Lives Matter, but to allow that conflict a natural tension,” he said. “And that’s the essence of great stories.”

Reading this on your iPhone or iPad? Check out our new Apple News app channel here and click the + at the top of the page to save to your Apple News favorites.

The access he gained to the OPD after a lot of “pushing back” and negotiation is remarkable, and allows audiences to listen in on pointed discussions and join officers out on patrol. After a long stint embedded with the department, Nicks came away with a relatively favorable opinion of Chief Whent, who was one of a series of top cops in what’s been a revolving door. He’d made “remarkable progress with reform,” said Nicks, who points to a temporary halt in officer-involved shootings in 2014 (which ended in 2015), and the chief’s decision to require officers to wear body cameras.

But Nicks also views him as a bit of Shakespearean character.

“He was so close to meeting the reforms that when the scandal came out, he didn’t attack this thing aggressively enough, and that’s a Shakespearean tragedy.”

From a viewer’s perspective, the contentious events provide a timely look at the challenges officers confront on a daily basis, illustrated especially well in an intense encounter between an officer and an angry Oakland man whose sister is struck by a car.

The film also gives voice to the concerns of activists and residents who have issues with a department that is still tethered to federal oversight because of the alleged misconduct of a band of rogue cops dubbed the “Oakland Riders.”

Standout sequences include Mayor Libby Schaaf talking candidly about what she expects from new recruits and Whent pondering whether to publicly release body camera video of two 2015 deaths, one of which was an officer-involved shooting.

But one of the film’s most insightful segments takes place at the academy as recruits watch video scenarios, such as an irate person advancing on officers. As they debate how to respond, their reactions show a wide range of opinions.

“That scene represents the complexity of the situation,” says Nicks. “What would I do? And I think for some people it’s very clear what they would do. (For others), it’s ‘why would you feel that way?’”

“The Force” is part of PBS’s “Independent Lens” series and will air on TV. It’s also expected to be released theatrically and is vying for a best U.S. documentary honors at Sundance to be announced Sunday.

Interview

Who: Peter Nicks

What: Director of “The Force”

Where: Entered in the U.S. Documentary competition at the Sundance Film Festival