Two teenagers have been caught filming themselves on mobile phones playing "chicken" on a Gloucester railway line.
The recordings were discovered by the father of one of the 14-year-olds who contacted the child's school which then informed British Transport Police.
One boy was seen to be sitting between two lines and missed being hit by a train by just five seconds.
The pair, from the Tuffley area of the city, were disciplined for trespassing on the railway line at Bodium Avenue.
Pc Alan Fishpool, from the British Transport Police, said it was one of the most dangerous incidents of the game he had come across.
"The trains on that particular piece of track go at 75mph, they are big trains, weighing about 200 tonnes and they can't move out of the way," he said.