View my account

How do I view .bag file?

Comments

15 comments

  • Aznie Syaarriehaah

    Hi Harley,
    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

    Regards,
    Aznie
    Intel RealSense Customer Support

    0
    Comment actions Permalink
  • Harleyzheng

    Hi Aznie

     

    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.

     

    Regards

    Harley

    0
    Comment actions Permalink
  • Aznie Syaarriehaah

    Hi Harley,

    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.

     

    Regards,

    Aznie

    Intel RealSense Customer Support

    0
    Comment actions Permalink
  • Harleyzheng

    Hi Aznie

     

    It worked! You have no idea how long I've been trying to figure this out. From the bottom of my heart, THANK YOU.

     

    Wish you the best

    Harley

    0
    Comment actions Permalink
  • Aznie Syaarriehaah

    Hi Harley,

    I am glad to hear that. Good luck with your thesis! ;)

     

    Regards,

    Aznie

    Intel RealSense Customer Support

    0
    Comment actions Permalink
  • Scolombomigliorero

    Hello, I'm trying to download the same tool from the link that you sent:

    https://github.com/IntelRealSense/librealsense/tree/master/tools/convert

    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?

    Thank you!!

    0
    Comment actions Permalink
  • MartyG

    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

    https://github.com/IntelRealSense/librealsense/releases/tag/v2.50.0

     

     

    0
    Comment actions Permalink
  • Scolombomigliorero

    Thank you!

    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!

    0
    Comment actions Permalink
  • Scolombomigliorero

    I tried again and I it works with the command of Github.

    Example: If you have 1.bag recorded 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 .csv file for each frame inside the .bag file.

    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

    Thanks!!

    0
    Comment actions Permalink
  • MartyG

    Please try removing the " " quotation marks from around the paths, like in the examples of rs-convert commands in the links below.

    https://github.com/IntelRealSense/librealsense/issues/2671#issuecomment-435773984

    https://github.com/IntelRealSense/librealsense/issues/6657#issuecomment-647022135

     

    Do the files appear in your Intel Test folder if you remove the quotation marks?

    0
    Comment actions Permalink
  • Scolombomigliorero

    Yes, I could with .pngs but it didn't work with .ply

    Here is the error:

     21/06 21:25:54,260 ERROR [2316] (playback_device.cpp:518) Failed to read next frame from file: Required '' field missing
     21/06 21:25:54,262 ERROR [2316] (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

    Thanks!

    0
    Comment actions Permalink
  • Scolombomigliorero

    I tried with another .bag file and it has a similar error:

     21/06 21:44:44,422 ERROR [21448] (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?

    0
    Comment actions Permalink
  • MartyG

    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.

    https://github.com/IntelRealSense/librealsense/issues/4777#issuecomment-551992599

     

    There have been occasional cases where rs-convert will not export to ply for unknown reasons.

    0
    Comment actions Permalink
  • Scolombomigliorero

    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.

    0
    Comment actions Permalink
  • MartyG

    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.

    https://support.intelrealsense.com/hc/en-us/community/posts/1500000579881/comments/1500000572881

    0
    Comment actions Permalink

Please sign in to leave a comment.