Stream Eye Cameras¶
Neon +1.1.2
Neon allows you to receive the eye cameras video stream with timestamps. Using the same receive_video_frames
method used for the scene camera, but using the sensor.eyes
that you can withdraw from direct_eyes_sensor.
status = await device.get_status()
sensor_eyes = status.direct_eyes_sensor()
async for frame in receive_video_frames(
sensor_eyes.url, run_loop=restart_on_disconnect
):
bgr_buffer = frame.bgr_buffer()

VideoFrame
VideoFrame
¶
Bases: NamedTuple
A video frame with timestamp information.
This class represents a video frame from the scene camera with associated timestamp information. The Class inherits VideoFrame from py.av library.
Methods:
-
bgr_buffer
–Convert the video frame to a BGR buffer.
-
to_ndarray
–Convert the video frame to a NumPy array.
Attributes:
-
av_frame
(VideoFrame
) –The video frame.
-
datetime
(datetime
) –Get timestamp as a datetime object.
-
timestamp_unix_ns
(int
) –Get timestamp in nanoseconds since Unix epoch.
-
timestamp_unix_seconds
(float
) –Timestamp in seconds since Unix epoch.
timestamp_unix_seconds
instance-attribute
¶
timestamp_unix_seconds: float
Timestamp in seconds since Unix epoch.
bgr_buffer
¶
bgr_buffer() -> BGRBuffer
Convert the video frame to a BGR buffer.
This method converts the video frame to a BGR buffer, which is a NumPy array with the shape (height, width, 3) and dtype uint8. The BGR format is commonly used in computer vision applications.
Returns:
-
BGRBuffer
(BGRBuffer
) –The BGR buffer as a NumPy array.
Source code in src/pupil_labs/realtime_api/streaming/video.py
46 47 48 49 50 51 52 53 54 55 56 57 |
|
to_ndarray
¶
Convert the video frame to a NumPy array.
Source code in src/pupil_labs/realtime_api/streaming/video.py
42 43 44 |
|
Check the whole example code here
stream_eyes_camera_video.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|