decoding video frame by frame (C extension)