-
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 - Dropped frames #8288
Comments
Hi @TheCrafft Was the bag file recorded in the RealSense Viewer program please? There has been past cases of resolution being halved due to a decimation post-processing filter being enabled when saving / recording files. If you are recording in the Viewer, I recommend checking under the post-processing sections of both the Stereo Module and RGB module to ensure that their respective decimation filters are disabled (indicated by a red icon beside them). Regarding loss of frames: using a fast-access storage device such as an SSD drive can be beneficial to recording in regard to reducing the likelihood of a bottleneck occurring during saving. It has been observed in the past on some low-end systems that recording with frame compression enabled may also cause performance problems. Extracting all frames from a bag can be difficult to achieve, and some scripts - of which there are many of them - are better at it than others. You could test the Python image extraction script in the link below to see whether it provides better performance. I note that in your own script though you seem to be extracting tiff images. You may have faster performance if you write the images as PNG images. |
Yes, the bag file was recorded in the RealSense Viewer. Decimation was on for the Stereo Module, but not for the RGB module. Thank you for pointing that one out! I do not remember having enabled frame compression. A quick scan shows me that my script is comparable to the one you linked. I guess I am already getting the most out of it. Aah yes! The reason I am using tiff instead of png is that the png frames had quite some loss. I do not mind the speed of performance as I run the script on a cluster. Still not sure what caused the loss. For future reference, would one stream (RGB) set at 1280 x 720 @30fps recorded to an SSD give the desired FPS, given that the machine is capable enough, or would lowering the resolution have a more consistent effect? |
I would agree that 1280x720 RGB at 30 FPS is a reasonable configuration, yes. If you are recording a bag at that configuration, the bag file will be larger in size than a lower resolution. I recently did a test where I recorded a 20 second bag at 30 FPS. 1280x720 produced a 274 mb bag, whilst 848x480 produced a bag of 138 mb size. If you are recording multiple bags for long durations, having a high capacity drive in terabytes instead of gigabytes may be necessary. |
Hi @TheCrafft Do you require further assistance with this case, please? Thanks! |
Hi @MartyG-RealSense Consider this solved! |
Great to hear, @TheCrafft - thanks very much for the update! |
Issue Description
Hi!
I was wondering if anyone could give me some insight regarding the extraction of frames from a .bag file and the loss of frames using the python package.
I have large .bag files which contain both depth (640x360; 30 FPS) and RGB streams (1280 x 720; ~16FPS). It has been a while since I collected them, but I am quite sure that I initially set both at 1280 x 720; 30 FPS. The data were recorded on an external HDD with USB 3.0.
Q1 What causes the change in resolution for the stereo module and why was the RGB camera not capable of achieving 30 FPS?
My current thought is that I actually set depth at 640x360; 30 FPS, assuming the viewer can't change resolution on its own, and that given the amount of data some frames from the RGB stream were dropped. I am currently not interested in the depth stream, but just find it odd.
Q1.1 Could replacing the HDD with and SSD resolve this issue?
The institution that I work for does not like the use of external programs, hence I am using the python package.
I followed the example shown in issue #1919 and made a few changes.
Script
This script works for extracting frames, when ran on a laptop it drops more frames than when ran on a HPC. Though, after closer inspection it appears that it only extracts 6 - 9 FPS, still not the 16 FPS it shows in the viewer. When reconstructing the frames in a video (.mp4), it appears that 12 FPS gives the most natural flowing image.
Q2 What can cause this loss of frames?
Q3 Why does 12 FPS result in the best all-round naturally flowing image?
The text was updated successfully, but these errors were encountered: