“Top Gun” actor Val Kilmer surprised everyone when he revealed that for the past 40 years, he’s been capturing his life and career on video, ending up with more than 800 hours of footage.

A feature documentary was the natural conclusion of his faithful chronicling, and when Kilmer mentioned that he was digitizing the footage to filmmaker Leo Scott, the idea for “Val” was hatched.

Scott had been editing “The Lotus Community Workshop,” a segment starring the actor within the 2012 omnibus “The Fourth Dimension,” and ended up helping with the digitization. He also brought in collaborator and fellow editor Ting Poo (“Heaven Is a Traffic Jam on the 405”) to make the documentary happen. It begins streaming on Amazon Prime Video on Aug. 6.

Scott and Poo served as both co-directors and co-editors, organizing the tapes, digitizing them and helping tell Kilmer’s story as well as shaping it into the sharp film that has generated awards buzz.

The film opens with archival footage of Kilmer with Tom Cruise on the set of “Top Gun” in 1986 before moving to the present day and setting up the story of Kilmer and his battle with throat cancer. An operation on his trachea has left him barely able to speak, so his 26-year-old son Jack — sounding eerily like his father — provides the documentary’s narration.

“We wanted to bring in the idea of a narrator,” Scott explains. “It was a beautiful thing to hear his son say, ‘My name is Val Kilmer and I’m an actor.’” The next scene cuts to Jack Kilmer in a booth recording that sentence.

Scott and Poo had tinkered with putting that reveal at the end, but by placing it up front, “It set up the language early on about who was doing the voice-over, so you can get lost in the story,” explains Poo.

The editors knew they didn’t want a four-hour film, so the challenge lay in the sheer amount of footage. Poo says that deciding what to omit was tough. “It was about being strict with what to get rid of and what to keep,” he says.

“Val” weaves seamlessly between past and present, chronicling Kilmer’s one-man show, “Citizen Twain,” filming notorious flops such as 1996’s “The Island of Dr. Moreau” and hits like 1995’s “Batman Forever,” while addressing his health struggles.

“We weren’t making a documentary, we were making a movie,” Scott says. “And Val plays himself.”