-
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
pyrealsense2: frames didn't arrive within 5000 #6766
Comments
If you do not need to extract images from the bag in real-time (i.e it is done after the bag is recorded) then it may be worth considering using the librealsense SDK's convert tool. https://github.com/IntelRealSense/librealsense/tree/master/tools/convert If you prefer to do it with Python, the script in the link below may be a useful reference for your own project. |
Hi @anguyen216 Do you still require assistance with this case, please? Thanks! |
Yes, I still have trouble with this case. I have about 500 .bag files I need to extract frames from. I create a a script to grab each .bag file and extract every 10 frames. Regardless of the file size, I got the runtime error, "frame didn't arrive within 5000," every 2 - 5 files. Even if I extract frames from these files individually, I still get the error. These file replayed perfectly well when thrown into Intel Realsense Viewer |
You are not the first person to be able to read bags in the RealSense Viewer but have problems extracting the frames from a sequence of multiple bags. A recent example of such a case by a RealSense Python user, who has a different problem to yours, is in the link below: If you are using a loop to read through the sequence of bag files, you may find helpful the advice given by a RealSense team member about how they implemented such a loop successfully. The code (C++ though, not Python) that the RealSense team member makes reference to basing their successful test program upon is at the start of the case. |
I've finally resolved my issue by creating a separate function to find number of frames in a bag file. I include a snippet of my code below, hopefully this will help other people in the future.
|
Great news about your success - thanks for the update and for kindly sharing your solution with the RealSense community! |
The function get_num_frames will not work as expected. For most of the bag files the actual Fps is not 30 even though it is set to 30 when it is recorded. |
@OldOG that's correct. I later found out about this issue and started a new issue on it. Even RealSense library function (rs-convert) that extracts frames in various formats (rgb, point cloud and depth) has the problem of frames drop. The correct and probably most efficient way to extract frames is to use ROS bag. I put the issue/solution below for future reference |
So thank you for this info. The frames drop drives me mad.... How ridiculous it is! The I/O functions should be the basic APIs of a library. |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
I wrote a script to automatically record and stream depth frames from the camera. The recorded bag file can be replayed using Intel RealSense viewer; however, when I try to run a script to extract the frame from the bag file with python, it keep getting the following error message
The file accurately identified the number of frame (how long the recorded video is), but keep crashing halfway through with the error above. I attached my code below. Please help!
The text was updated successfully, but these errors were encountered: