Пример #1
0
def test_simple():
    frame_id = 4000
    dset = one.alyx.rest('datasets',
                         'list',
                         session=eid,
                         name='_iblrig_leftCamera.raw.mp4')[0]
    url = next(fr['data_url'] for fr in dset['file_records'] if fr['data_url'])
    vs = VideoStreamer(url)
    f, im = vs.get_frame(frame_id)
    assert vs.total_frames == 77897
    assert f
    vs = VideoStreamer(dset)
    f, im2 = vs.get_frame(frame_id)
    assert np.all(im == im2)
Пример #2
0
 def test_video_streamer(self):
     dset = one.alyx.rest('datasets',
                          'list',
                          session=self.eid,
                          name='_iblrig_leftCamera.raw.mp4')[0]
     url = next(fr['data_url'] for fr in dset['file_records']
                if fr['data_url'])
     frame_id = 5
     vs = VideoStreamer(url)
     f, im = vs.get_frame(frame_id)
     assert f
     assert vs.total_frames == 144120
     # Test with data set dict
     vs = VideoStreamer(dset)
     f, im2 = vs.get_frame(frame_id)
     assert np.all(im == im2)
Пример #3
0
from oneibl.stream import VideoStreamer

FRAME_ID = 4000

# example 1: with URL directly
url = "http://ibl.flatironinstitute.org/mainenlab/Subjects/ZM_1743/2019" \
      "-06-17/001/raw_video_data/_iblrig_leftCamera.raw.00002677-a6d1-49fb-888b-66679184ee0e.mp4"
vs = VideoStreamer(url)
f, im = vs.get_frame(FRAME_ID)

# example 2: with URL directly
from oneibl.one import ONE  # noqa

one = ONE()
eid = "a9fb578a-9d7d-42b4-8dbc-3b419ce9f424"
dset = one.alyx.rest('datasets',
                     'list',
                     session=eid,
                     name='_iblrig_leftCamera.raw.mp4')
vs = VideoStreamer(dset[0])
f, im = vs.get_frame(FRAME_ID)