You'll want the shelf to be as firm and solid as possible to ensure that there'll be no movement at all to the track once it's laid. Forget MDF. It's liable to sagging and is affected by temperature and humidity, plus waterbased paints and adhesives won't do it any good either. Use 3/4" ply. If you've a stud wall, place the brackets on the studs, which will probably be every 16" (40cm). Use a stud-finder if necessary. If it's a solid wall, just use the same spacing.