“Lincoln,” through its civics-lesson nobility, and “Django Unchained,” through its giddy violence, made feel-good entertainment from one of the ultimate feel-bad experiences of U.S. history.

“12 Years a Slave” is a stinging corrective, a film about plantation slavery as seen from inside the cage. It is not a rousing story of rebellion against bondage, but a somber account of enduring it. The film is both brutal to watch and stunning to contemplate, powerfully challenging audiences — particularly white audiences — to examine their consciences.

English director Steve McQueen, who began as a visual artist, insists that we see the effects of whips on flesh and nooses on necks in unblinking detail. He straightforwardly portrays the horror of slave life, never soft-pedaling the revulsion and estrangement that audiences of any color may feel confronting it.

We are accustomed to movies that use violence to arouse us, but not to rebuke us. What McQueen presents here head-on is a historical obscenity. America permitted — accepted — the buying and selling of human beings for 246 years. The fact that so few films have confronted it is also an obscenity.

The film takes its story from the memoir of Solomon Northup, a literate free black family man, carpenter and violinist. In 1841 he was lured from his home in Upstate New York, drugged, stripped of his identity and sold as a laborer in Louisiana. From the moment Northup awakes to find himself a chained captive in a white man’s slave pen, he is in an unending nightmare.

McQueen’s subject matter is heartbreaking, but his approach is austere. John Ridley’s script captures the poetic, formal diction of 19th-century speech and song, but it features vast stretches of silence. Most of the film’s scenes are constructed around a single, indelible image.

Indelible and bruising. Northup is beaten across the back with 15 cruel strokes of a wooden bat by his captors. The camera alternates between shots of Northup’s agonized expression and his assailant’s sadistic scowl. On the last stroke the bat finally breaks, and so does something inside Northup. From that moment on, his struggle is not for freedom primarily, but for survival and sanity.

One of the film’s few special-effects shots shows the city where he is entrapped: Washington, D.C., the Capitol visible in the background. He is transported to the New Orleans slave markets on a riverboat. All we see of the craft is its paddle wheel, churning the water like some infernal meat grinder. Paul Giamatti plays the slave trader, who sells his new lot of humans as if it were a mundane business. Only Northup is shocked and amazed by it.

Chiwetel Ejiofor makes Northup a man richly layered with pride and hurt, now furious, now resigned and frightened, now beseeching. A good actor can make a wronged character sympathetic. Struggling against despair, shedding his old identity to survive, Ejiofor inhabits the role so fully he becomes tragic.

The film is rife with villains, dupes and heroic characters, but it insists on the human ambiguity of each one. Master Ford, Northup’s first owner, played by Benedict Cumberbatch, is a cultured, pious-hearted Christian. He holds soothing Sunday gospel readings with his family and slaves mingled side by side. He gives Platt, as the slave is now called, a fiddle, and forcefully intervenes when a brutal foreman abuses him. Yet Ford sells him to another plantation. The man is his property, after all. He has the receipt for the purchase.

Michael Fassbender is terrifying as Edwin Epps, Northup’s vicious new owner. He quotes scripture as well (Luke 12:47, a passage reverberating with ironies Epps can’t discern) to justify the lashing of any slave who fails to deliver his daily cotton quota. Like livestock, slaves may have kind or cruel owners, but there are always owners.

We might wish that Northup were an intrepid hero, but he’s a terrified everyman. At one point, he is forced to lash his friend Patsey (Lupita Nyong’o, in a riveting debut), because Epps knows that forcing him to harm her will further break his spirit. Under slavery even friendship can be perverted into a tool of oppression.

The film has a nuanced understanding of slavery, a legal status that was not necessarily permanent. It notes that indentured white debtors worked and suffered alongside black slaves. Alfre Woodard has a standout cameo as a cynical former slave who charmed and married her owner and holds court on her mansion’s portico, with slaves pouring her tea. Encountering such characters reinforces Northup’s hope for rescue. Freedom lost can be restored. When Brad Pitt arrives on the scene as a Canadian with abolitionist sympathies, the machinery of justice begins to work. For one man.

The film is not a flawless masterpiece. McQueen doesn’t communicate the cadence of time passing, and he triple-underlines his points (an intercepted letter to Northup’s family can’t be burned without its dying embers being squeezed for every drop of blatant pathos). Still, it is a bold, important provocation.

The key scene occurs at midpoint as Northup endures a terrible peril, one that should make every witness throw down his tools and come running. Instead, background characters go about their business, heads down, afraid to intervene. It’s a reminder that looking the other way supports injustice. See the film. Read the original (Northup’s engrossing narrative is readily available as a free e-book). Think about it deeply.