Over the past 15 years, much of Ben Stiller’s work — “Zoolander,” “Meet the Parents,” “There’s Something About Mary,” “Tropic Thunder” — has turned not only into box-office gold but also something bigger, zeitgeist-defining comedies that play on in our minds and cable-TV schedules. Love him, get annoyed by him or simply think he’ll never top a certain hair-gel moment, Stiller is one of this era’s most influential comic presences.

Or maybe was one of its most influential comedic presences.

Stiller, in many ways, says goodbye to all that with “The Secret Life of Walter Mitty,” his fifth feature directorial effort, which he also produced and stars in. The movie doesn’t pass up the occasional joke or fantasy sequence, but it has serious, even heartbreaking, stuff on its mind — big meaning-of-life questions as a once-promising young man, now in his 40s, stares into the chasm of squandered potential.

Older filmgoers will recall Danny Kaye’s 1947 “Mitty,” also based on James Thurber’s classic 1939 New Yorker story. That film was a series of loosely connected sketch pieces about a henpecked suburban man.

Mitty 2.0 is pitched differently. As a former youth skateboard champion caught in a rut as a low-level Life magazine photo editor, Mitty decides to embark on real-life quests to shake things up, pursuing a lost photograph halfway around the globe and slowly working up the courage to ask out a colleague (Kristen Wiig).

Written by the dramatic-minded Steven Conrad (“The Pursuit of Happyness”), it’s a movie that shows, with no small amount of melancholy, how bad breaks can negate hope and talent — and asks what, if anything, we can do about it.

If the film’s mix of self-seriousness and whimsy has vexed some critics — Variety called it “a feature-length ‘Just Do It’ ad for restless middle-aged” audiences — it reflects a director himself struggling under the yoke of unrealized ambition and his encroaching AARP status.

“This movie relates to me personally,” said Stiller, 48. “It’s where I am in my life right now. When you’re in the world of creating things, you’re constantly trying to get somewhere where you haven’t been. And that’s the dilemma Walter faces.”

Stiller was looking out at the Manhattan skyline from a skyscraper astride Central Park, contemplating a career that has taken him from quirky humorist to one of the world’s most bankable comedy stars.

Yet a restlessness pervades. He wants to direct far more than he wants to act. He has a newfound inclination for historical tales, not the comedies he once seemed to crank out by the fistful. One of Hollywood’s most complex personalities — at once charming and irascible, performative and squirmy — stands at a threshold. And despite their places at opposite ends of the success spectrum, he and Mitty have more in common than you might expect.

It was a cold day in Iceland, even by Iceland standards. It was even colder if you’d plunged into the sea, as Stiller had just done. He’d submerged himself to shoot multiple takes as Mitty, small watercraft buzzing around him. He emerged dripping and shivering and was hurried to an inflatable hot tub. Production assistants enrobed him in towels.

“Ben’s teeth were chattering, and his whole body was rocking back and forth,” said production designer Jeff Mann. “Most people would just try to warm up. But Ben asked for the handheld monitor and began studying it. Then he looked at it, gave some notes and said, ‘Let’s go again.’”

On the two “Night at the Museum” films, director Shawn Levy had a similar encounter with what he calls Stiller’s “fierce perfectionism,” going through the script page by page with the actor. When they finished, Levy took Stiller’s notes back to the writers for a new pass. He then took the revised draft back to Stiller and repeated the process. “We’ll do this 10-12 times,” said Levy. “Okay, 12 is the most we’ve done,” he added and laughed.

That meticulousness held on “Mitty.” Stiller about two years ago was set to star in the film, which during 17 years in development had hit the shoals with several directors, including Steven Spielberg and Gore Verbinski. After reading Conrad’s script, though, Stiller began writing elaborate notes in its margins. “It was not something you’d normally see an actor do,” said John Goldwyn, the film’s producer.

As imagined by Stiller and Conrad, their movie would contain some comic nuggets. But it would largely reflect the frustration of middle-age and middle-class males and the wages of loneliness.

Stiller wangled a budget of nearly $100 million. He brought on a crack visual team. He began pushing the cast to enter the melancholy head space he wanted the film to occupy, sending them a group of emo songs. And he honed the character into someone who, when he eventually responds to his circumstance, does so with surprising ferocity.

“It’s almost pathological how many obstacles Ben chooses to put in front of himself,” Mann said.

Levy said the stories of Stiller as demanding are accurate, but the attitude is fairly applied. “Ben wants to be surrounded by people who work as hard and worry as much as him. That’s all he wants,” said the director. Stuart Cornfeld, Stiller’s longtime producing partner, said, “I think that most everybody who’s worked with him understands he is driven and he drives the people he works with, but it’s ultimately about the thing that’s external to himself.”

In person, Stiller can be thoughtful, even playfully childlike; his text alert on his cellphone is the voice of George Takei. He also can be confident and funny, especially in front of crowds; before a New York Film Festival screening of “Mitty,” he quipped that “a lot of people think studios are bad and these faceless, greedy corporations.” Pause. “And they are.”

But there’s also a rawness, a sense that certain questions or comments can set him on edge.

Asked whether it matters that awards tastemakers haven’t thus far been kind to “Mitty,” he tightly shook his head before attempting a joke. He also seemed to take offense at the idea that he, Owen Wilson and others had once formed a comedy “frat pack,” shorthand for the group after they collaborated on a string of hits. “I have no idea where it came from,” he said. “I would venture to say none of us in this so-called thing — I don’t even say the name — ever felt that.”

It’s a little hard to remember after the barrage of “Along Came Polly,” “Meet the Fockers” and other commercial comedies, but Stiller’s early career — his first two feature directing efforts, the generational touchstone “Reality Bites” and “The Cable Guy,” along with his short-lived sketch series “The Ben Stiller Show” — was marked by a darker brand of introspection, a commercial gloss hiding existential themes.

Back then, before he had chiseled out the nice-guy archetype that has proved so lucrative, we witnessed a man worried about the big questions and coping with them through comedy, a Gen-X Woody Allen of sorts.

Stiller said that the instinct hasn’t gone away. In fact, he sees this picture as a bookend to his first film. “With ‘Reality Bites’ I also was looking at my life. I had a different perspective. I was looking forward all the time, thinking about the next step, and the movie was about that,” he said. “At this point it’s wanting to put the brakes on and enjoy where I am and who I am right now, which is what this movie is about.”

— Los Angeles Times