def tiles_from_vid(pv_video, start_frame=0, end_frame=None):
    """
    A tile generator from a pyvision3 video object

    Parameters
    ----------
    pv_video: pyvision3 video
        You may want to use the size= option in the constructor
        of the video so that tile-sized images are generated
    start_frame: int
        Starting frame, defaults to 0
    end_frame: int
        Ending frame, defaults to None, meaning to use the
        complete duration of the video

    Returns
    -------
    A tile generator, yielding tuples like: (str(frame_num), image, None)
    """
    start_frame = 0 if start_frame < 0 else start_frame
    if start_frame != pv_video.current_frame_num:
        pv_video.seek_to(start_frame)
    for tile in pv_video:
        if end_frame is not None:
            if pv_video.current_frame_num > end_frame:
                raise StopIteration
        yield str(pv_video.current_frame_num), tile, None
