GithubHelp home page GithubHelp logo

lachie-aerialrobotics / rosbag2video Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mlaiacker/rosbag2video

0.0 0.0 0.0 73 KB

converts image sequence in ros bag files to video files

License: GNU General Public License v2.0

Python 100.00%

rosbag2video's Introduction

rosbag2video

rosbag2video.py
rosbag to video file conversion tool
by Maximilian Laiacker 2020
[email protected]

with contributions from Abel Gabor 2019
[email protected]

For use with ROS2 bags, please refer to the foxy branch.

For use with ROS1 bags, please proceed with the instructions below.

Install:

ffmpeg is needed and can be installed on Ubuntu with:

sudo apt install ffmpeg

ros and other stuff

sudo apt install python3-roslib python3-sensor-msgs python3-opencv

Usage:

rosbag2video.py [--fps 25] [--rate 1] [-o outputfile] [-v] [-s] [-t topic] bagfile1 [bagfile2] ...

Converts image sequence(s) in ros bag file(s) to video file(s) with fixed frame rate using ffmpeg
ffmpeg needs to be installed!

--fps   Sets FPS value that is passed to ffmpeg
        Default is 25.
-h      Displays this help.
--ofile (-o) sets output file name.
        If no output file name (-o) is given the filename '<prefix><topic>.mp4' is used and default output codec is h264.
        Multiple image topics are supported only when -o option is _not_ used.
        ffmpeg  will guess the format according to given extension.
        Compressed and raw image messages are supported with mono8 and bgr8/rgb8/bggr8/rggb8 formats.
--rate  (-r) You may slow down or speed up the video.
        Default is 1.0, that keeps the original speed.
-s      Shows each and every image extracted from the rosbag file (cv_bride is needed).
--topic (-t) Only the images from topic "topic" are used for the video output.
-v      Verbose messages are displayed.
--prefix (-p) set a output file name prefix othervise 'bagfile1' is used (if -o is not set).
--start Optional start time in seconds.
--end   Optional end time in seconds.

Example Output:

./rosbag2video.py camera_and_state.bag

rosbag2video, by Maximilian Laiacker 2020 and Abel Gabor 2019

############# COMPRESSED IMAGE  ######################
/image_raw/compressed  with datatype: sensor_msgs/CompressedImage

frame=   77 fps= 13 q=28.0 size=    1280kB time=00:00:00.96 bitrate=10922.2kbits/s speed=0.156x

rosbag2video's People

Contributors

abelgabornng avatar mlaiacker avatar nicolaiharich avatar petrapa6 avatar plusk01 avatar sneheshs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.