A film reel with nine minutes of rare, startlingly clear footage of a San Francisco in ruins two weeks after the 1906 earthquake and fire has surfaced at a flea market.

Film historians say the footage, a series of clips, was produced by an early San Francisco studio run by the Miles brothers — Harry, Herbert, Joseph and Earl. It’s a bookend to their most famous work, “A Trip Down Market Street,” a 13-minute movie shot from a cable car days before the earthquake.

The newly found footage chronicles a similar trip down Market Street, from Fifth Street to the Ferry Building. But in this one, many of the buildings lining the city’s main thoroughfare have collapsed.

The film also shows crowds of people and horse-drawn wagons waiting to get on a ferry to Oakland, the wrecked City Hall that eventually had to be torn down, and damaged buildings being blown up with dynamite.

Film historian David Kiehn confirmed the origin of the nitrate film and spent eight months preparing a digital version. It will premiere at the Niles Essanay Silent Film Museum in Fremont on April 14.

“Miles brothers footage shot after the earthquake is extremely difficult to find,” Kiehn said. “They shot more footage than anyone else after the earthquake, almost 7,000 feet of it, I believe — almost two hours of footage, and practically none of it survived.

“This nine-minute piece is the biggest segment that I’ve seen anywhere,” Kiehn said, “and another great part of this footage is it re-creates ‘A Trip Down Market Street.’”

Kiehn made headlines in 2010 when he challenged the Library of Congress’ 1905 date on “A Trip Down Market Street,” and using weather and vehicle registration records proved it was shot just days before the big earthquake. His discovery was featured on “60 Minutes.”

Nitrate film is highly flammable and delicate, and Kiehn built an optical printer to take digital images of each frame and convert the newly found film into a digital format.

“It’s a very slow process, running it through the machine,” he said. “It took 20 hours, an hour or two at a time. I had to be there at the machine nursing it through. There are 8,600 frames through the film. It took a few seconds to copy each frame.”

David Silver, a collector of vintage cameras, found the film at the Alemany Flea Market in 2016. He said he bought it from a man who was “standing there looking through a length of it with a lit cigarette hanging from his lips.”

“We were an inch away from it going up in flames,” Silver said.

Silver posted news of his find on the Facebook group San Francisco Remembered in January 2017, writing, “For those of you who scream and flee in panic at the mere mention of nitrate, have no fear, the film is in splendid condition, no outward signs of chemical deterioration, and surprisingly little smell when I opened the Pathe can.”

Jason Wright, a photography historian and collector living in England, saw the post and purchased the reel from Silver. He enlisted the help of Kiehn.

“Eighty or 90 percent of it is completely unseen footage,” Wright said. “And 10 percent is much better quality (than the earlier film). It’s pretty much a new discovery.”