David Bowie documentary film director Brett Morgen was so overwhelmed by work on Moonage Daydream that he suffered a massive heart attack while editing the project.

Bowie meticulously documented his career from the ’70s up until his death in 2016, leaving behind at least 5 million assets — including still photos, audio tapes, 16mm and 35mm film — for his estate to reckon with.

When Morgen got the go-ahead to make Moonage Daydream, he began sifting through that mountain of material. In four months, Morgen’s entire budget was spent, and he had no choice but to do all of the rest of the work himself.

For the next two years, the director spent most of his days from 8am to midnight working alone in a dark studio, obsessed with crafting Bowie’s “cinematic odyssey.”

“I had a massive heart attack on January 5, 2017,” he told NME.

“Flatlined for three minutes.”

Morgen spent the next week in a coma. When he regained conscious, he was greeted by chilling feelings of emptiness and uncomfortable questions like, “What’s my life been worth?”

The director admits he’s often struggled to forge balance between his work and his personal life. His near-death experience provided a vital recalibration, and he began rethinking the Moonage Daydream story, and what Bowie’s story could teach the world.

“It was a real reset,” he added. “And it was then that I realised that this film would be an opportunity to know, to live a satisfying and fulfilling life in the 21st century.”

Moonage Daydream includes much rumoured but never-before-seen footage of Bowie at the height of his powers. It includes pivotal moments from Bowie’s life and career. But most importantly it attempts to illustrate the Thin White Duke’s perspective on life, art and experience.

“It’s meant to be a mirror so that you, the audience, can see your own Bowie and reflect back upon your own life,” Morgen said. “Because to me, the most exciting thing is that you can go and see a film about David Bowie and learn how to be a better parent or learn how to live a more satisfying life.”

Moonage Daydream is in cinemas now.