'Reads a frame at time t. Note for coders: getting an arbitrary
frame in the video with ffmpeg can be painfully slow if some
decoding has to be done. This function tries to avoid fectching
arbitrary frames whenever possible, by moving between adjacent
frames.'

def seek(self, pos):

    if ((pos < self.pos) or (pos > (self.pos + 1000000))):
        t = ((1.0 * pos) / self.fps)
        self.initialize(t)
    elif (pos > self.pos):
        self.skip_chunk((pos - self.pos))
    self.pos = pos
