CCTV of level crossing near miss in Carmarthenshire
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.