I gave up trying to launch properly ECCE and parsing trj files directly frame by frame. Instead I saved output of MD from terminal to file. It contains blocks of XYZ coordinates of atoms repeating with constant periodicity. Just a few lines in python to clean the garbage worked for me.