コード例 #1
0
def test_numpy_frames(small_robot_mp4_vid):
    clip_frames = small_robot_mp4_vid.get_frames((3, 7, 9))
    np_vid = Video.from_numpy(clip_frames)

    assert np.all(
        np.equal(np_vid.get_frame(1), small_robot_mp4_vid.get_frame(7)))
コード例 #2
0
def test_from_filename():
    assert type(Video.from_filename(TEST_H5_FILE).backend) == HDF5Video
    assert type(
        Video.from_filename(TEST_SMALL_ROBOT_MP4_FILE).backend) == MediaVideo
コード例 #3
0
def test_mp4_file_not_found():
    with pytest.raises(FileNotFoundError):
        vid = Video.from_media("non-existent-filename.mp4")
        vid.channels