def sizes_to_offsets(sizes):
    """takes list of (frame_size, frame_frames) tuples
    and converts it to a list of (cumulative_size, frame_frames)
    tuples"""
    current_position = 0
    offsets = []
    for frame_size, frame_frames in sizes:
        offsets.append((current_position, frame_frames))
        current_position += frame_size
    return offsets
