Ejemplo n.º 1
0
     1.3),  # 19 <= Medium (Brug onder)
    (-1, False, 'StrandGolfbaan_b_01.mp4', (848, 480),
     1.3),  # 20 <= Kort en bruikbaar
]
frame_rate, flip_frame, wh, video_list_name, video_url, video_file_name = \
    FileSelection(video_source, video_list).file_with_index(
        2
    )

print('Project opened')
window_title = '{} ({})'.format(video_file_name, video_list_name)
video_stream = VideoStream(video_url, grab=False, resize=wh)
if video_stream.load():
    rectangle_stream = RectangleStream(video_stream.wh(), (8 * 1, 8 * 1),
                                       rows=10,
                                       margin=1)
    window_stream = WindowStream(window_title, frame_rate)
    state = StateManager(video_stream, rectangle_stream, window_stream)
while True:
    # noinspection PyUnboundLocalVariable
    if not video_stream.next():
        video_stream.disable_auto_grab()
    # noinspection PyUnboundLocalVariable
    state.show()
    # noinspection PyUnboundLocalVariable
    key = window_stream.show(video_stream.view_frame())
    # noinspection PyUnboundLocalVariable
    if state.accept(key) is False:
        break
print('Project closed')