(directory, orange_file)
Remove orange frames from the beginning of the video
Remove orange frames from the beginning of the video
Remove orange frames from the beginning of the video
def remove_orange_frames(directory, orange_file):
    """Remove orange frames from the beginning of the video"""
    frames = sorted(glob.glob(os.path.join(directory, 'video-*.png')))
    if len(frames):
        logging.debug("Scanning for orange frames...")
        for frame in frames:
            if is_color_frame(frame, orange_file):
                logging.debug("Removing Orange frame: %s", frame)
                os.remove(frame)
            else:
                break
        for frame in reversed(frames):
            if is_color_frame(frame, orange_file):
                logging.debug("Removing orange frame %s from the end", frame)
                os.remove(frame)
            else:
                break
def remove_orange_frames ( directory , orange_file ) : frames = sorted ( glob . glob ( os . path . join ( directory , 'video-*.png' ) ) ) if len ( frames ) : logging . debug ( "Scanning for orange frames..." ) for frame in frames : if is_color_frame ( frame , orange_file ) : logging . debug ( "Removing Orange frame: %s" , frame ) os . remove ( frame ) else : break for frame in reversed ( frames ) : if is_color_frame ( frame , orange_file ) : logging . debug ( "Removing orange frame %s from the end" , frame ) os . remove ( frame ) else : break