Bob Costas guest stars as himself in Season 3, Episode...

Bob Costas guest stars as himself in Season 3, Episode 2 of "Brockmire" with Hank Azaria on IFC. Credit: Kim Simms/IFC

Bob Costas has what he calls a “very extensive and somewhat bizarre filmography,” generally playing himself in such classics as the 1998 film “BASEketball” and 2001’s “Pootie Tang.”

But come April 10, America will see him stretch his acting craft in a new direction in IFC’s “Brockmire,” starring Hank Azaria as a profane, alcohol-challenged, trouble-prone baseball announcer named Jim Brockmire.

In keeping with the show’s raunchy comedic tone, Costas shares a meal with Brockmire in which . . . well, let’s just say Costas uses language not in keeping with his cultured image.

Bob Costas, left, and Hank Azaria, right in an Season...

Bob Costas, left, and Hank Azaria, right in an Season 3, Episode 2 of IFC's "Brockmire." Credit: Kim Simms/IFC

He could not recall doing so previously on screen himself, although he has been around naughty language before.

“There was a lot of stuff going around me and Al Michaels in ‘BASEketball,’ and God knows what was happening in ‘Pootie Tang’ beyond my own scenes,” he said.

Costas appears in the second episode of the third season, in which he reconnects with Brockmire, who is looking for a favor for George Brett, who also plays himself.

Things go well until Brockmire admits he was the one who gave Costas his infamous case of pink eye during the Sochi Olympics in 2014, which Costas hosted for NBC.

Punch line: “The tough part was getting it into the second eye,” Brockmire says.

Costas, who grew up in Commack, appears in the third episode as well, in a mini-mockumentary that mimics Ken Burns’ 1994 series “Baseball.”

“They even went out and found ’90s wardrobe stuff, like wide lapels,” he said. “I had a hairdresser there blowing my hair out so it looked a little bigger.”

Costas got to know Azaria after the actor sent him early episodes of the show. He noted Azaria’s feel for creating a generic baseball announcer.

“He appreciated the fact that baseball announcers — I’m sure I’m not the only one — totally got this character who is kind of a combination of various people who will go unnamed. We all know it when we hear it. He just added all the dark, perverse aspects of it, and it keeps getting better as it goes.”

Azaria has had a long and successful run as a voice actor on “The Simpsons.”

“He gets not just the sound but the rhythm, the little verbal tics,” Costas said. “He’s especially observant about broadcasting. He could knowledgably discuss the differences between Lindsey Nelson and Bob Murphy, or between Jack Buck and Ernie Harwell.”

Azaria, an avid Mets fan, invited Costas to appear on the show. Other announcers also have appeared, notably Joe Buck. Costas’ scene was filmed in October.

Costas said he did not hesitate to poke fun at his eye problems in Sochi, which forced him off the air for a time.

“If you had a broken leg, it’s under the table, nobody knows; you just soldier on,” he said. “We’ve all gone to work when we’re less than 100 percent. This was literally written all over my face. I had to acknowledge it.”

So what happened? “To this day, I don’t know,” he said. “Here’s what I do know: I do know none of the theories that were floated out there at the time were true. That leaves, I guess, hundreds of other possibilities. So why not pin it on Jim Brockmire?”

Costas, 67, has more time this year to pursue other interests after parting ways with NBC. He still works for MLB Network, calling 20 or so regular-season games, starting Tuesday night with Bryce Harper’s return to Washington as a Phillie, as well as two in the postseason.

“I only want to do baseball this year,” he said. “If I do anything else, it will begin in 2020.”

In January, the New York Post reported Costas and NBC had agreed to end his contract early. In February, ESPN detailed the long road to that point, notably his discomfort with covering the NFL, a crucial part of NBC’s sports business.

Eventually, there simply was not much left for him to do at the network.

“Think of it this way: If NBC lost hockey, would Mike Emrick be mad at them? No,” Costas said. “But he’d have to go someplace to do hockey, because that’s what he does.”

NBC does not have rights to baseball or the NBA, Costas had decided to stop hosting Olympics, he had “ambivalent” feelings about the NFL and broadcast networks generally do not do longform sports journalism.

“You look around and go, ‘What is it exactly that I’m doing here?’ ” Costas said. “You don’t say that angrily. You just say, ‘Hey, we’ve reached a point of diminishing returns, no hard feelings, all good.’ ”

Costas said he gave NBC a year’s notice that after the 2016 Olympics he would exercise an “emeritus clause” in his contract, becoming akin to what Tom Brokaw does for NBC News. But that role, he said, “wasn’t working out quite the way I envisioned.”

Soon both sides agreed it was time to move on. “Reasonable, good-natured people look around and said, ‘Yeah, that’s right, there’s not enough for you to do here that taps into what you’re interested in and what you’re good at,’  ” he said.

“It’s like a saxophone player at the Grand Ole Opry. Everybody there, they admire the saxophone player and his ability, but there’s no place for him in the band.”

More sports media