From frame to stomach-churning frame, The Post has learned what role each of the Trinitarios gang members are alleged to have played in the slaughter of an innocent teen at a Bronx bodega.

Police and prosecutors have identified all eight men accused of killing 15-year-old Lesandro “Junior” Guzman-Feliz on June 20 and described their alleged roles in the caught-on-video murder.

They have all professed their innocence.

The attack began in the Cruz and Chiky Grocery in Tremont at East 183rd Street and Bathgate Avenue, where Guzman-Feliz, an aspiring NYPD detective, tried to hide from his pursuers, who authorities say had mistaken him for another young man.

Surveillance video shows the boy climb over the counter, even as a worker tries to stop him.

A man in a green do-rag — identified by authorities as Danel Fernandez, 21 — then walks into the store.

He is followed by 19-year-old Kevin Alvarez in a white T-shirt, authorities said.

Based on the prosecutors’ identification of the suspects, this is what the videos show happens next:

Fernandez and Alvarez drag their prey outside as Guzman-Feliz clings to the doorway and desperately flails, trying to escape.

Meanwhile, another video shot from an apartment window shows several other gangbangers prowling outside.

Just as Fernandez and Alvarez wrench Guzman-Feliz loose from the doorway, José Muniz, 21, enters the frame and brings down a machete on the boy’s torso and legs at least twice in a hacking motion.

Next into the frenzy is a mask-wearing Elvin Garcia, 23, who can be seen in video unleashing eight thrusts of his knife.

Alvarez then takes off down East 183rd Street.

Fernandez pulls a blade from his waistband and leans in to strike, but apparently can’t get a good angle and runs off.

Then three more join the melee. They’re identified as Manuel Rivera, in a black T-shirt and black pants; Jonaiki Martinez, in a red hat and a white tank top; and another man, dressed all in black, visible only in the apartment video.

The unidentified man makes multiple thrusts before running off down Bathgate Avenue.

Rivera gets in at least four plunges of his knife and bolts, leaving Martinez to perform what is believed to be the killing blow.

Gripping Guzman-Feliz from behind, Martinez drags his blade across the teen’s throat, then turns and races off.

Bleeding out, Guzman-Feliz goes back into the store to plead for help. He briefly collapses on the counter as a bodega worker and another figure motion frantically toward the door. Guzman-Feliz hoists himself up and exits.

Next, he’s seen outside, appearing to yell something and motioning with his hands. He then begins jogging toward St. Barnabas Hospital a block away.

A final video, shot down the block, shows the gore-covered teen clinging to life as people try to stanch his wounds with what appear to be napkins.

Blood covers the boy’s right leg and much of his left. It streams down his throat and onto his chest.

Several people scream, including a man who yells, “That’s Junior! That’s Junior, bro!”

“Oh, my gosh, my little brother,” a woman bawls.

All seven men, plus an eighth, José Taveres, have been variously charged with murder, gang assault and assault with a weapon.

They all pleaded not guilty at their arraignments.