How do I view .bag file?
I am a civil engineering honours student using the L515 as a part of my thesis. I am very lost right now as I have no experience with programming. I have used the Viewer to record some data (surface of water flowing down a spillway) and now I need to analyse it to determine some statistics about the surface profile. I'm hopping to do this in matlab.
I'm not 100% on where I should start but I feel like I should begin by converting the .bag file to something where I can actually view the values of depth for each frame? I saw a bunch of 'tools' on github that said they can convert .bag files but I have no idea what the steps are when it comes to actually using these tools. Again, I have no experience with programming.
One of the tools im looking at is https://github.com/UnaNancyOwen/rs_bag2image. What do I need to install on my computer and how do I set up the folders so I can run the code and it'll work?
Any guidance is much appreciated.
The .bag files contain uncompressed and unfiltered data and hence tend to be rather large (in the order of 100 MB per one second of recording). RealSense data can be exported in or converted from one format to another, they include:
- raw (image)
- ply (3D data such as point clouds)
- bag (a 'rosbag' file recording, typically containing 2D data)
- png (image)
- csv (tabular data suited to databases and spreadsheets)
- bin (depth matrix)
The RealSense SDK 2.0 has a tool called Convert that can convert .bag files to the above formats.
Convert Tool: https://github.com/IntelRealSense/librealsense/tree/master/tools/convert
Intel RealSense Customer Support
Thank you for your reply. I'm hoping for some more guidance with regards to how to use the rs-convert.exe file mentioned on the Github page.
I've downloaded the SDK and can see rs-convert.exe in the tools folder. When I click on it, a window which looks like the 'Command Prompt' window pops up and then disappears immediately. It happens every time I try to open it.
I've tried opening the Windows command prompt and it says "'rs-convert.exe' is not recognized as an internal or external command,
operable program or batch file." when I use the command.
EDIT: When I click on rs-ar-basic.exe and rs-callback.exe they open a prompt, but not rs-convert.
The rs-convert exe should be launched in the Command Prompt from the SDK's Tools folder. An easy way to go to that folder in Command Prompt is:
1. Open Command Prompt window,go to the Tools folder which the rs-convert is located.
cd C://Program Files (x86)/Intel RealSense SDK 2.0/Tools
2. Input the rs-convert conversion command. Below example for CVS file:
rs-convert.exe -i "YOUR_BAG_FILE_DIR\Aznie.bag" -v "DIR_FOR_THE_CONVERTED_FILE"
Then, wait until the percentage of the conversion become 100%. Check your DIR_FOR_THE_CONVERTED_FILE folder for the output file.
Intel RealSense Customer Support
Hello, I'm trying to download the same tool from the link that you sent:
But I can't find the 'rs-convert.exe' that you're talking about.
I'm only see this on Github:
Where can I find the .exe? How can I download this tool?
Hi Scolombomigliorero If you are using Windows and have installed the full RealSense SDK for Windows then you can find the rs-convert tool at the following location on your computer:
C: > Program Files (x86) > Intel RealSense SDK 2.0 > tools
If you have not yet installed the RealSense SDK on Windows then you can do so by visiting the link below, going to the 'Assets' file list at the bottom of the page and then downloading and running the installer file Intel.RealSense.SDK-WIN10
I have the .exe now.
I tried to export the .bag file with it but I can't find my exported files.I used the Command Prompt with the lines that you said (I tried with -p and -v) but there are not any new files in my destination forder (C:\Users\sanson\Documents\intel test)
Do you know where I can find my files or if there is another problem?
Thank you again!
I tried again and I it works with the command of Github.
Example: If you have
1.bagrecorded from the Viewer or from API, copy it next to
rs-convert.exe(for Windows), launch the command line and enter:
rs-convert.exe -v test -i 1.bag. This will generate one
.csvfile for each frame inside the
Several converters can be used simultaneously, e.g.:
rs-convert -i some.bag -p some_dir/some_file_prefix -r some_another_dir/some_another_file_prefix
Please try removing the " " quotation marks from around the paths, like in the examples of rs-convert commands in the links below.
Do the files appear in your Intel Test folder if you remove the quotation marks?
Yes, I could with .pngs but it didn't work with .ply
Here is the error:
21/06 21:25:54,260 ERROR  (playback_device.cpp:518) Failed to read next frame from file: Required '' field missing
21/06 21:25:54,262 ERROR  (dispatcher.cpp:35) Dispatcher [000001ADA5FF2850] exception caught: Required '' field missing
Do you know what could be the problem?
I tried with the same .bag file, it works for .csv or .png but not with .ply
I tried with another .bag file and it has a similar error:
21/06 21:44:44,422 ERROR  (playback_device.cpp:518) Failed to read next frame from file: Required '' field missing
I am using the same line that I used before but with an -l to convert it as PLY. My Command Prompt said that the file is "100% PLY converter" but in the folder I only see a new .log with this error.
Do you have any idea of what could be the probem?
There was a past case at the link below where this particular error occurred with ply export only whilst the other export formats worked. The RealSense user in that case tested on multiple Windows 10 computers but were unable to resolve the problem.
There have been occasional cases where rs-convert will not export to ply for unknown reasons.
Mmm, I see. Thank you for your answer.
This could be a problem. What do you recomend me to do? Did you tried to convert a .bag in .ply with this tool?
I can tried to record a new .bag with another computer and see if it works.
I would love to have some .ply files but I don't know if the converter works for that or if it has a bug.
Right now I'm using a PC with Windows 10.
Yes, I have experienced this issue with ply export from rs-convert.
If you are not able to achieve ply export with this tool then there are options for doing so with program scripting.
Please sign in to leave a comment.