We study the formation mechanism of nanoparticles in thin films of the superconductor YBa2Cu3O7-δ (YBCO). We form the films by metal-organic deposition (MOD) on buffered, textured metal substrates. Through the addition of Dy or Zr salts to the precursor solution we precipitate (Y,Dy)2O3 and BaZrO3 nanoparticles, uniformly distributed through the film thickness. By quenching samples during the film growth, we show the nanoparticles form in the precursor layer before YBCO growth. The size of the nanoparticles was quantitatively analysed by TEM. We found that Zr doping produces smaller nanoparticles than Dy doping.