if you are going though all the 1000 files looping a ffmpeg, you'll run into memory i think
becuase somtimes ffmoeg has that bad habbit of locking files and not finishing the process when there are multiple instances
i dont know why, but better manage the code carefully