Idris Elba gives a magisterial performance in Justin Chadwick’s adaptation of Nelson Mandela’s autobiographical memoir, but unhappily the film isn’t quite worthy of him or its subject, coming across as a sibling of Richard Attenborough’s “Gandhi,” which was widely regarded upon its release in 1982 but in retrospect seems a ploddingly reverential portrayal of a great man. In this more jaded age, “Mandela: Long Walk to Freedom” probably won’t earn the same degree of immediate praise, even though the South African leader’s recent death gives the film special currency. It ends up a better history lesson than it is a movie, though a fairly good history lesson.

The fundamental problem is that rather than making an intelligent selection of episodes from Mandela’s life and organizing them in an imaginative and effective fashion, William Nicholson’s script tries simply to cover everything, which means not covering much of anything adequately. And Chadwick follows his lead with a dogged, workmanlike approach that makes the picture feel like a somewhat truncated television mini-series. Thus it begins not with a walk but a gambol—young boys, including Mandela, running through sun-drenched fields in what turns into a ceremony acknowledging their entrance to manhood. Not for the last time, Alex Heffes music swells up on the soundtrack to impress on us, unnecessarily, the importance this child will eventually assume.

There follows an account of Mandela’s adoption as a hardworking Johannesburg lawyer of political activism in response to South Africa’s unjust policies on race. His entrance into the African National Congress, which morphs from an organization modeled on Gandhi’s philosophy of non-violent civil disobedience to something more aggressive, is paralleled in his personal life by the failure of his first marriage to Evelyn Mase (Terry Pheto) and the occurrence of his second to Winnie Madikzela (Naomie Harris).

The story of Nelson and Winnie, in fact, becomes one of the more interesting aspects of the film’s long middle portion, which is devoted to his quarter-century imprisonment at Robben Island as a result of the ANC’s campaign of sabotage. Here Nicholson and Chadwick are effective in drawing a contrast between his increasing certainty that the success of the campaign against apartheid will depend on a willingness to talk rationally with his adversaries—an attitude nicely conveyed in the curious friendship that grows between him and one of the facility’s guards—and his wife’s ever more belligerent perspective, which will become evident after his eventual release by the government after negotiations with emissaries of President de Klerk (Gys de Villiers) finally bore fruit. Even in this case, however, the film undermines itself, first by shunting Winnie—well played by Harris—to the sidelines too often, and by reducing the contribution of international pressure on the regime’s eventual capitulation to some fleeting newsreel-type interruptions.

“Walk” concludes not only by celebrating Mandela’s emergence from prison, however, but by briefly showing his moral courage in impressing a need for reconciliation rather than vengeance on his followers as he moved toward the presidency, and in taking concrete steps to make that vision a reality after winning the office. The picture closes by suggesting, rather than showing in detail, how firmly—and amiably—he held to that approach in his single term, making for a post-apartheid South Africa that has avoided the paroxysm of violence that could easily have followed such a traumatic political change.

There are sporadic moments in “Mandela” that really evoke the greatness of its subject, almost all scenes involving either Elba of Harris that are self-consciously mounted for emotional effect but are still effective for all that. (Harris, for instance, certainly puts across the sequence showing the brutality of Winnie’s time in prison, where she endured torture that goes far to explain her later bellicosity.) Too often, however, it slips into what might be called cruise-control mode, simply laying out historical information in a flat chronological sequence that rarely captures the horrifying nature of the events—even the acts of violence that accompany the regime’s attempts to suppress the growing dissent in the townships. And no one in the rest of the cast is given much an opportunity to do more than what’s expected of them, though their work is certainly professional.

The behind-the-camera crew also do a solid job, even though Lee Crawley’s cinematography does sometimes go for obvious effects, just like Heffes’ score does. Special praise goes to production designer Johnny Breedt, the art direction team led by Willie Botha, and costumers Diana Cilliers and Ruy Filipe for the scrupulous attention to period detail.

It’s impossible not to be moved by the story of Nelson Mandela, but that’s due more to the man than to this movie. “Mandela: Long Walk to Freedom” is a respectable effort, but far from an inspired one.