Using Imagemagick is a start:
To extract a frame from an MPEG1/2 should work like:
I'd advise you not to use convert for this - it uncompresses the entire movie into /tmp, picks the frame you want, then trashes the frames. On a big MPEG file this can take 10 mins and eat several gigs of HD space. mplayer works great; use an edl to specify a time offset.