# Turning a MPG video into a set of coordinates

I have a video in MPG format showing a white mouse with a strong black dot on the head moving around on an off-white background, so effectively a black dot moving around on a 2-D plain surface. From this video, I want to generate a set of coordinates that describe the position of the black dot as it varies with time, that is $(X_1, Y_1),...,(X_t,Y_t)$ relative to some arbitrary point on the surface, such as the centre of the image. I also want to create a set of arrays representing a grid across the plain, with $0$s across the grid, except for a $1$ for where the mouse is at time $t$. That is, the motion of the mouse down in a small surface in 3 time steps/frames would be represented by $$\begin{matrix} 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{matrix}$$ $$\begin{matrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{matrix}$$ $$\begin{matrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \end{matrix}$$ or $(2,3), (2,2), (2,1)$.

I think the first stage is to somehow convert the video into a set of still images, so effectively split the video into the frames that make it up. I have a mac, and any suggestions on a piece of software to do this would be much appreciated.

The second stage requires some kind of image processing package, but again, I'm not sure what to use, so advice would be much appreciated.

The project I am working on requires the final data (i.e, matrix and coordinate) forms, and isn't that concerned with how I get the data in the first place, so I am looking for simple software packages that lets me get this data. However, if anyone has some code in matlab or python that lets me analyse the still images from scratch, that would be appreciated too.

Thanks!