Skip to content
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

Segmentation fault in reading frames of *.bag file #8601

Closed
kir-ark opened this issue Mar 16, 2021 · 5 comments
Closed

Segmentation fault in reading frames of *.bag file #8601

kir-ark opened this issue Mar 16, 2021 · 5 comments

Comments

@kir-ark
Copy link

kir-ark commented Mar 16, 2021


Required Info
Camera Model D435
Firmware Version 05.10.03.00
Operating System & Version Linux (Ubuntu 16)
Kernel Version (Linux Only) 4.15.0-50-generic
Platform PC
SDK Version 2.42.0.2924
Language python
Segment others

This issue is similar to #5503.
I extract frames from a *.bag file by index (index maps to time and passes to seek() function) and then display depth and color frames. Then at some point when the pipeline stops (pipeline.stop()), my application crashes with segmentation fault error. I tried different bag files with different stream settings. Segmentation fault happens in a random time.

I attached the script that reproduces the problem. It plays a *.bag file frame by frame using seek() function to imitate access by index.
bag_reader.py.zip

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 17, 2021

Hi @kir-ark In past cases, this kind of error with bag frame scripts has tended to occur when reading bags using a loop. The link below has an example of this:

#6887

It sounds as though you want to playback the bag file and display its contents on-screen, and not extract the frames into files. If that is correct, the SDK's read_bag_example.py bag reading Python example program may be a useful test script.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/read_bag_example.py

Though the above example reads depth frames, a RealSense user edited it to add support for RGB frames.

#2652

@kir-ark
Copy link
Author

kir-ark commented Mar 19, 2021

I see your point, but that doesn't work for my purposes. This read_bag_example.py read frames one by one. Instead of that I need to read random frame at an arbitrary time. That is why I using seek() function. The example above bag_reader.zip is particular case just to show you the segmetation fault error. In more general case I need to read one random frame at a time.

I suppose the crash happens because of using registration method.

Could you please explain is there any other method to read random frame at a time or figure out why segmentation fault occurs in using registration and seek function?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 19, 2021

Jumping to a specific frame in a bag during playback does not usually work well when set_real_time = false. Starting at the first frame and skipping forward to the target frame has been recommended instead.

#3121 (comment)

A discussion about use of playback.seek() in Python can be found at the link below:

#4804

@MartyG-RealSense
Copy link
Collaborator

Hi @kir-ark Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants