def get_start_and_total_frames(file_format):
    i = 0
    start_frame = None
    nr_of_frames = 0
    while True:
        exists = False
        if os.path.isfile(file_format.replace('#', str(i))):
            exists = True
            nr_of_frames += 1
        if (start_frame is None):
            if exists:
                start_frame = i
            elif (i > 1):
                break
        elif (not exists):
            break
        i += 1
    return (start_frame, nr_of_frames)
def get_start_and_total_frames(file_format):
    i = 0
    start_frame = None
    nr_of_frames = 0
    while True:
        exists = False
        if os.path.isfile(file_format.replace('#', str(i))):
            exists = True
            nr_of_frames += 1
        if (start_frame is None):
            if exists:
                start_frame = i
            elif (i > 1):
                break
        elif (not exists):
            break
        i += 1
    return (start_frame, nr_of_frames)