A mother has sobbed in court as footage was played showing the terrifying moment she drove into the path of an oncoming freight train with her three children in the car.

The woman, who cannot be named for legal reasons, failed to stop as the train passed over a small country road near Taree, on the mid north coast, in April 2016.

Footage taken from the train showed the woman's car slamming on the brakes and skidding onto the tracks.

The train driver blows a horn shortly before impact, and debris can be seen flying into the air as the train's brakes screech.