Media playback is unsupported on your device Media caption CCTV shows gunman before and after incident

New footage from this year's deadly school shooting in Parkland, Florida, shows officials were "underprepared" and "overwhelmed", local media say.

Surveillance footage from inside Marjory Stoneman Douglas High School was revealed on Friday as part of a 10-month investigation by the South Florida Sun Sentinel.

The footage shows "58 minutes of chaos" on the campus, the Sun Sentinel says.

Seventeen people died in the shooting in February, including 14 students.

"A gunman with an AR-15 fired the bullets, but a series of blunders, bad policies, sketchy training and poor leadership helped him succeed," the Sun Sentinel says, after it reconstructed events using surveillance footage and official reports.

Its investigation comes as a preliminary report into the shooting is set to be delivered to state officials on 1 January.

A draft version, from the Marjory Stoneman Douglas High School Public Safety Commission, was released earlier this month.

What does the new CCTV reveal?

The local news website uses footage from inside the school to explore, minute-by-minute, the events of 14 February.

The shooting, one of the deadliest in US contemporary history, prompted national protests and walkouts by students over school safety.

A former student of the school, Nikolas Cruz, has been charged over the attack.

The Sun Sentinel's timeline shows that despite the suspect entering the school campus with a rifle bag, several members of staff appear to fail to promptly report a Code Red - a measure that could have put school students into lockdown.

Image copyright Police via South Florida Sun Sentinel Image caption Six students died on the third floor outside of classrooms

Instead the building's fire alarm went off, prompting some students to leave their classrooms, heading towards harm's way, footage shows.

Authorities say Nikolas Cruz, a former student of the school, killed 11 on the school's first floor and six more on the school's third floor.

The students on the third level died outside classrooms in the corridor and stairwell, officials say.

One student, Joaquin Oliver, died outside a toilet that had been locked, apparently due to recurring problems with students vaping inside them.

What does the report say?

The 407-page draft document collates more than nine months of timelines and testimony.

Its contents touch on failures like closing school gates, and detail the online activity of the suspect strongly hinting toward his intentions in advance of the attack.

Scot Peterson, an armed officer stationed at the school, received heavy criticism, including from the President Donald Trump, for failing to enter the school building and engage the shooter.

But both the Sun Sentinel's investigation and the commission have pointed to wider policing failures.

Image copyright Police via South Florida Sun Sentinel Image caption Footage from inside the school shows the gunman shooting in corridors

Seven officers who arrived on the scene were recommended by the preliminary report for further internal review.

"Since Columbine, officers are taught to rush toward gunshots and neutralize the killer. But the first Broward deputies don't rush in," the Sentinel reports, referring to the 1999 Colorado school shooting that left 13 people and two perpetrators dead.

The newspaper uses diagrams and body-cam footage to show the police delays outside the building.

The draft report also revealed this may have been compounded by confusion involving the rewinding of surveillance footage.

Some officials believed that footage being played back was live, meaning their timeline of where the gunman was was distorted.

As the Sun Sentinel put it, "Cruz has already walked to a nearby Walmart and ordered a drink at Subway" while police believed he was on the building's second floor.

Image copyright Getty Images Image caption Cruz's lawyers have said he will plead guilty if he can avoid the death penalty

The newspaper's investigation included newly available footage of the gunman running away from the school after he discarded his weapon, in an attempt to blend in with evacuating students.

Andrew Pollack, whose daughter died in the shooting, shared the Sun Sentinel's piece on Twitter - describing the alleged failures it laid out as "heartbreaking".

He also called for Broward County's Sheriff, Scott Israel, to resign from office.

The sheriff has faced mounting pressure regarding his office's handing of the shooting.

Following the draft report, Mr Israel released a document detailing changes implemented already - including additional training for its officers.

In a statement this week, he asserted the reforms were "not the end of the process", insisting it would also implement recommendations from the commission.

Will teachers get guns?

The commission's panel voted 13-1 in favour of state lawmakers allowing trained teachers to carry firearms in school.

The proposal is backed by President Trump, and earlier this month his administration's Federal Commission on School Safety also threw its support behind it.

In 14 US states, there are already some teachers that carry guns - but a wider policy remains politically divisive.

Some parents of victims and surviving students have spoken out against it in recent days.

One of school's students who helped lead national protests in the aftermath, Cameron Kasky, wrote for CNN that he was "shocked" by the recommendation and denied it would make him feel safer.