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

Converting bag file into avi file for each stream like RGB and Depth Map #6107

Closed
humayun opened this issue Mar 22, 2020 · 3 comments
Closed

Comments

@humayun
Copy link

humayun commented Mar 22, 2020

  • 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 :)


Required Info
Camera Model { R200 / F200 / SR300 / ZR300 / D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win (8.1/10) / Linux (Ubuntu 14/16/17) / MacOS
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC/Raspberry Pi/ NVIDIA Jetson / etc..
SDK Version { legacy / 2.. }
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

<Describe your issue / question / feature request / etc..>

I have bag files created using RealSenseD435 camera. I want to convert RGB and Depth image into avi or any other format which can input into Pose Estimation model.

Second, these bag files are very big like in 3 to 5 GB for 1 to 2 minutes video. How can I crop object within the video and also decrease frame per second rate when converting into avi or any other format from bag file.

Thank you.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 22, 2020

The RealSense SDK has a conversion tool called rs-convert that can convert a bag file created in the SDK into a range of file formats (though not video formats such as avi).

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

A round-about way of creating a video would be to convert the bag into a set of PNG images with the rs-convert tool and then convert that image set into a video. Googling for 'convert png set to video' provides more information about ways to do this.

Regarding cropping images, it is possible to define a region of the screen called a 'bounding box' when generating the camera image and exclude data outside of that box area. The link below has more information about this method. Though it may not be an option if you can only use bag files already recorded and not create new bags.

#2016

If you are able to record bag files outside of the RealSense SDK software by using ROS, an option for making the bag files smaller would be to use the 'split' functions of ROS' bag editing tool. This tool has features such as cutting an already recorded bag by specifying a start and end point and then re-saving it as a new smaller bag, and automatically closing recording and starting recording to a new bag file after a certain time period or file size has been reached.

Bag files created in ROS may have incompatibilities with bag functions in RealSense SDK tools such as rs-convert though (intended for using bags created in the RealSense SDK), which would make conversion to other formats difficult.

#2424 (comment)

A workaround may be to play the bag file whilst a full-screen video capture program is running, so that everything on the screen is recorded as a video. If you would like to use a free video capture program, google for 'free video capture software' for some suggestions.

Of the ones that have free versions but require payment for the fully featured version, fraps for Windows has been popular for many years and has the option to set a custom frame rate.

https://www.fraps.com/

Another popular recording option for Windows, Linux and Mac is OBS (Open Broadcaster Software).

https://obsproject.com/

@neilyoung
Copy link
Contributor

You can derive the images from the bag and use ffmpeg to create a video again. Works at least for mp4. From mp4 to avi a conversion is possible.

@MartyG-RealSense
Copy link
Collaborator

This case will be closed after 7 days from the time of writing this message if there are no further comments. Thanks!

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

No branches or pull requests

3 participants