The dem file format is documented by Uwe Girlich (author of lmpc) at http://www.quakewiki.net/archives/demospecs/dem/dem.html
(not sure if that's the original URL).
I don't think you could call Quake deterministic, there's a lot of random events (calls to rand in progs.dat) Not sure what the random seed is though. Thus, demo files do not track player input. Rather they store entity positions, frames, angles, etc, for all entities, not only the player.