Peter Morgan wouldn’t be the first screenwriter you’d think of to tell the story of the 1976 Formula One rivalry between the uptight clinician Niki Lauda and the seat-of-his pants swashbuckler James Hunt.

Known for upscale real-life stories about presidents and royals ("Frost/Nixon," "The Queen"), the screenwriter would be far down the list among people putting pen to paper on two hyper-competitive auto jocks.

But Morgan — who wrote the script for this weekend’s wide Ron Howard release “Rush” starring Chris Hemsworth and Daniel Bruhl — found himself stirred by the idea when it first struck him on a Spanish beach.

PHOTOS: Movie Sneaks 2013

“Here you had the most beautiful Englishman who ever lived in James Hunt and then an endlessly interesting human being in Niki Lauda,” Morgan said. “They had different views on life, death and everything else you could imagine. And at the same time they’re also weirdly similar. It was a fantastic story.”

Sitting on the sand on an Ibiza vacation, the two-time Oscar nominee mentioned the notion of a Hunt-Lauda movie to his wife. As it turned out, decades before, Lauda had once asked out the screenwriter’s future spouse — unsuccessfully, “or at least so she claims” — and knew Lauda from Vienna circles, where she grew up. Lauda now lives in Ibiza part-time, so Morgan’s wife made the introduction, and a few days later the screenwriter and the driver were having lunch.

After that initial meeting, Morgan then made the project a crusade — first bringing it to Paul Greengrass, who was eager to do it but for a slightly higher budget than he could find financing for, and then quickly after with Howard, who ended up making the movie for about $45 million.

Both directors, it should be said, wanted to make it with Bruhl — something that financiers and distributors were wary of. “It’s easy for people to say, 'Let’s get Christian Bale for Niki because there’s a facial similarity and because he’s a big star.' The minute you say we’re going to cast a German, you’re immediately shrinking the pre-sales — even in Germany.”

PHOTOS: Hollywood backlot moments

The movie was financed independently by Cross Creek Pictures and Exclusive Media and acquired by Universal Pictures. Howard even went to the American Film Market to raise money, something that until the present a Hollywood veteran rarely had to do.

Morgan, though, said he understands why mainstream Hollywood was skeptical.

“There’s no goodie and no baddie. It’s a story between a weird disfigured Austrian and a British whoring drunk. That’s a hard thing for a studio executive to get his or her head around.”

Of Lauda, disfigured in a notorious crash at Nurburgring and to this day a kind of charming crank, Morgan added, "What I love about him is he’s so at peace with himself in his obnoxiousness.” Morgan continued, "You couldn’t sell a studio executive on that easily either. (Of course, the story does receive a charisma boost from Hunt, whom Morgan describes as “Casanova and James Bond and a great driver all rolled into one." Morgan, incidentally, was a writer on "Skyfall.")

Morgan found that there were some dramatic limitations too. For instance, the more flowery dialogue he was able to put in the mouth of Tony Blair or Queen Elizabeth II had to be kept in check here. “When you’re writing Formula One drivers, there’s a limit to how much you can push them verbally; it can't become too artificial," he said.

So he kept the speechifying to a minimum — save for a powerful monologue from Lauda that pretty much closes the film — and lets characters have their say largely on the racetrack or with short exchanges in the paddock and press room. (Morgan, incidentally, has some provocative thoughts himself about the frenzy of fall films. “'Gravity,’ ‘Rush,’ 'Prisoners' within three weeks, and then 'Captain Phillips' — people go to a theater once every two months so why force them into these kinds of terrible decisions? It’s an industry killing itself.” But more on that later.)

He acknowledges that he had to invent certain things for the sake of the "Rush" drama. “The hitchhiking scene didn’t happen. James didn’t punch a journalist. And for all I know Niki and James didn’t meet in an airplane hangar,” he said of three key scenes in the movie. “But truth is more important than accuracy. Everything about Niki and James in the film is absolutely emotionally true, and I hope that’s what makes it powerful.”

ALSO:

Movie review: 'Rush'

Auto-racing film 'Rush' takes a different route with Niki Lauda

'Cloudy With a Chance of Meatballs 2' set for clear box office win

Follow me on Twitter at http://twitter.com/ZeitchikLAT