RealSense Bag file reader.

Only the first color and depth streams from the bag file will be read.

  • The streams must have the same frame rate.

  • The color stream must have RGB 8 bit (RGB8/BGR8) pixel format

  • The depth stream must have 16 bit unsigned int (Z16) pixel format

The output is synchronized color and depth frame pairs with the depth frame aligned to the color frame. Unsynchronized frames will be dropped. With alignment, the depth and color frames have the same viewpoint and resolution. See format documentation here


A few frames may be dropped if user code takes a long time (>10 frame intervals) to process a frame.

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self)

  2. __init__(self, buffer_size=32)


buffer_size (int, optional, default=32) – Size of internal frame buffer, increase this if you experience frame drops.

close(self: None#

Close the opened RS bag playback.

static create(filename)#

Create RGBD video reader based on filename


filename (os.PathLike) – Path to the RGBD video file.


get_timestamp(self: int#

Get current timestamp (in us).

is_eof(self: bool#

Check if the RS bag file is all read.

is_opened(self: bool#

Check if the RS bag file is opened.

next_frame(self: open3d.cpu.pybind.t.geometry.RGBDImage#

Get next frame from the RS bag playback and returns the RGBD object.

open(self, filename)#

Open an RS bag playback.


filename (str) – Path to the RGBD video file.



save_frames(self, frame_path, start_time_us=0, end_time_us=18446744073709551615)#

Save synchronized and aligned individual frames to subfolders.

  • frame_path (str) – Frames will be stored in stream subfolders ‘color’ and ‘depth’ here. The intrinsic camera calibration for the color stream will be saved in ‘intrinsic.json’

  • start_time_us (int, optional, default=0) – Start saving frames from this time (us)

  • end_time_us (int, optional, default=18446744073709551615) – (default video length) Save frames till this time (us)



seek_timestamp(self, timestamp)#

Seek to the timestamp (in us).


timestamp (int) – Timestamp in the video (usec).



property metadata#

Get metadata of the RS bag playback.