In a more just world, Mahershala Ali, one of America’s most gifted actors, would have played the lead in at least a dozen films by now.He’s certainly paid his dues and then some. Over the past two decades, the 47-year-old actor has starred or played key roles in prestige series (HBO’s “True Detective”), sci-fi franchises (“The Hunger Games”) and network-defining political thrillers (Netflix’s “House of Cards”). In 2017, he won his first Academy Award for his performance in “Moonlight,” a master class in what you can do with just 20 minutes or so of screen time, and a second Oscar two years later, for his performance in “Green Book.”So it may come as a shock to learn that Ali has never played the lead role in a feature film before, not until his star turn in the sci-fi drama “Swan Song,” now streaming on Apple TV+.“I always felt like a bit of a late bloomer,” Ali said.On a recent morning, in a wide-ranging video interview from his home in the San Francisco Bay Area, Ali, dressed in a black jacket over a crisp white Team Ikuzawa T-shirt, talked about “Swan Song,” the debut feature from the Irish director Benjamin Cleary.In “Swan Song,” Ali plays both a dying man and his clone.Apple TV+As if to make up for lost time, Ali plays not just one main character in the sci-fi drama, but two: Cameron, a terminally ill husband and father of a 5-year-old son; and Jack, the perfect clone of himself — complete with every one of his memories — who, unbeknown to Cameron’s wife and child, will soon replace him in order to spare them the grief and pain of having to watch him die. In several scenes, Ali shares the stage with Ali, with only himself to play against. “It was fun after it was hard,” he said with a laugh. “Fun after you move through the hard.”It was a winding life journey that took him to “Swan Song,” with stops and starts and moments of doubt along the way. Like the time he was in his second year of New York University’s prestigious graduate acting program and considered ditching it all to go back to working as a deckhand in San Francisco. “I was still in the union,” he said, “and it’s good money.”Or another time, in the middle of his acting career, when he took off a year and a half to care for his ailing grandfather. “He had a stroke in 2010, and I kind of dropped everything,” he said. “I was living in Las Vegas and taking care of him, just me and my grandma.”And there were other reasons that the actor is only now playing his first film lead. The industry was a lot different back when he was coming up, he explained — more stratified between movies and series, which made feature film roles, let alone feature film leads, tougher for TV actors like himself to come by. Those who started in TV were seen as TV actors only, and so his aim was just to be the best TV actor he could be. He was well into the third season of his third series, “The 4400,” before he was finally called on to “step on Brad Pitt’s character” (a monstrous child whom Ali’s character literally stumbles upon at a nursing home) in “The Curious Case of Benjamin Button.”Ali is “a really powerful actor, but he also has a really calming energy as a scene partner,” said Awkwafina, his “Swan Song” co-star. “It was probably one of the best experiences I’ve had on a set.”Chanell Stone for The New York TimesOther film roles followed — in “The Place Beyond the Pines,” “The Hunger Games” and, in 2016, “Moonlight” — but no leads.Around the time “Moonlight” was released, a writer for The New York Times conceded that Ali’s rise, unlike those of some of his peers, “has not been meteoric.”“When I look at my trajectory, my start was a little slow, if you think about where I am at the moment,” Ali said.Even so, many of the supporting roles he was getting were ones any actor would kill for, like Juan in “Moonlight,” a hard-on-the-surface dope dealer bursting with love for his young charge. “I hadn’t seen that character,” he said. Or Don Shirley, the African American pianist in the biopic “Green Book” who hired an Italian American bouncer, played by Viggo Mortensen, to serve as his valet in the Deep South. “He was the most gracious type of rebellious you could be,” Ali said of the musician. “Somebody who was so smart and cunning and found a way to buck the system by hiring a white guy to carry his bags in and out of a hotel, and be his bodyguard, in 1962? I thought that was genius.”Ali won his first Oscar for his supporting turn in “Moonlight” (2016), opposite Alex Hibbert.David Bornfriend/A24Two years later, he won best supporting actor again, this time for “Green Book,” alongside Viggo Mortensen.Patti Perret/Universal Pictures“Swan Song” came to Ali in 2019, after he read the script and asked to meet with Cleary, its writer. Cleary had won an Oscar for his 2015 short film, “Stutterer,” but had never directed a feature film before. After a single “really great conversation” between the two, Ali said yes to the project. “It was one of the most beautiful moments of my life,” Cleary recalled.Five Movies to Watch This WinterCard 1 of 51. “The Power of the Dog”: More