-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load all recorded frames from a Bag file-D435i #6565
Comments
Another pyrealsense2 user experienced the RuntimeError: Frame didn't arrive within 5000 error when trying to read a bag. They were advised to set up a profile and define a playback time. |
Thanks. I tried this code from your answer. However, it is running extremely slow. The code generated 66 frames only in 5 minutes and still running. is there a simple way to find the total number of captured frames in a bag file? |
The most common method that I have seen RealSense users apply to determine the number of captured frames is to extract the frames into other formats such as PNG or a CSV text-based file. This can be done outside of Python using an SDK tool called rs-convert: https://github.com/IntelRealSense/librealsense/tree/master/tools/convert There is a pre-built Windows version called rs-convert.exe at this SDK folder location: C: > Program Files (x86) > Intel RealSense SDK 2.0 > Tools There is also a simpler bag-reading script for pyrealsense2 here: |
Thank you for your answer. I tried the rs-convert.exe and it skips many frames (Python could retrieve more frames!!). I spent so much time searching online for a valid way to retrieve all the frames from a bag file without any useful solution. My application is based on analyzing depth at every single frame. The capability of D435 of producing high fps was the main reason to consider it in my project. is there any valid way to retrieve all frames from a bag file? |
There is a Python discussion with a couple of comment links that may be useful. The first is a bag extraction script, and the second has a suggestion for how to read a bag without losing frames. |
Hey, I am using the rs-convert tool and the generated .csv files it contains 1280 cols,720 rows where can I know which columns corresponds to accelerometer data, gyroscope data |
@vams08 csv is a depth matrix format that stores a text representation of a depth image. I'm not aware of IMU information being stored in it The link below has an example of a csv that roughly illustrates the characteristics of the original depth image. |
@MartyG-RealSense is there any way to get IMU data from pre-recorded files(.bag format) |
@vams08 There is not much information on the subject, and what there is refers to the Python language. If you only want the IMU data from the bag then it may be straightforward. If you want to extract both IMU and depth at the same time then it may be more complicated. The links below offer Python scripting: |
Hi @vams08 Do you still require assistance with this case please, or can it be closed? Thanks! |
@MartyG-RealSense yeah it can be closed thanks for support. |
@vams08 Thanks so much for the update! |
HI
i am new to this field. I used my d435i to record a bag file for a project. I am trying to process this bag file using python 2.7. However, the code crashes before loading all the frames. I used the SDK viewer to play the bag file and it works fine without any errors.
I am using 848X100 with 300 fps as i am trying to capture a fast moving object. Recording duration is 50 secs which makes is around 15000 frames in total. The code crashes when it loads around 6000 frames. When the code crashes, i get the below error. I tried increasing the wait time to 10000 but still received the same error.
RuntimeError: Frame didn't arrive within 5000
I searched online but i could not find a solution for this issue.
Camera: D435i
firmware: 05.12.05
Windows 10/PC
SDK V2.33.1
Python 2.7
Here is the code i am using to read the bag file:
import cv2
import numpy as np
import pyrealsense2 as rs
import pandas as pd
print("Environment Ready")
pipe = rs.pipeline()
cfg = rs.config()
cfg.enable_device_from_file("test2.bag",repeat_playback=False)
profile = pipe.start(cfg)
for x in range(5):
pipe.wait_for_frames()
i=0
try:
finally:
# Stop streaming
pipe.stop()
Thanks
The text was updated successfully, but these errors were encountered: