CCTV of level crossing near miss in Carmarthenshire
11 May 2013 Last updated at 15:55 BST
Work is to be carried out to make level crossings safer after 33 near misses and two crashes in Wales in the past year.
Network Rail will be building footbridges, adding new barriers and using more modern technology.
It is also closing some level crossings and appointing managers at nine.
CCTV captured this near miss by a driver on a level crossing in Llangadog, Carmarthenshire, in 2009.