Skip to content

Interface between OpenCV video facilities and ROS image transport library.

License

Notifications You must be signed in to change notification settings

xperroni/cv_video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CV Video

CV Video integrates OpenCV's video recording and replaying API's to ROS.

Build & Install

CV Video is built using catkin. Type the commands below on a terminal window to create a catkin workspace, clone the repository and build the sources:

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ git clone https://github.com/xperroni/cv_video.git
$ cd ..
$ catkin_make

Features

CV Video can be used as a collection of standalone ROS nodes, a library, or an action server with a C++ client API.

Nodes

CV Video includes two standalone ROS nodes, record and replay, which can be used respectively to record and replay video files. Moreover, the camcorder action server provides video recording services for external nodes.

camcorder

The camcorder node records images from a ROS image topic and writes them to a video file. It can be accessed by external ROS nodes through an Action API.

Topics

image (sensor_msgs/Image)

Subscribed topic from which frames are recorded.

Parameters

~path (string, default: "<current working directory>/video.mpg")

Default output video file path.

~format (string, default: MPEG)

Default output video file encoding format.

~framerate (double, default: 30.0)

Default frame rate, in Frames Per Second (FPS).

~width (integer, default: 640)

Default frame width, in pixels.

~height (integer, default: 640)

Default frame height, in pixels.

record

The record node records images from a ROS image topic and writes them to a video file.

Topics

image (sensor_msgs/Image)

Subscribed topic from which frames are recorded.

Parameters

~path (string, default: "<current working directory>/video.mpg")

Path to the output video file.

~format (string, default: MPEG)

Output video file's encoding format.

~framerate (double, default: 30.0)

The recorded video file's frame rate, in Frames Per Second (FPS).

~width (integer, default: 640)

The width of recorded frames, in pixels.

~height (integer, default: 640)

The height of recorded frames, in pixels.

replay

The replay node reads a video file and publishes its frames to a ROS image topic. See the image_transport API for details on how to read from the topic.

Topics

image (sensor_msgs/Image)

Topic to which replayed frames are published.

playing (std_msgs/Bool)

Enables other nodes to pause and resume a replay session. An `std_msgs/Bool` message published to this topic with a `false` value will pause the node, while a `true` value will make it resume.

Parameters

~path (string, default: "<current working directory>/video.mpg")

Path to the replayed video file.

~playing (boolean, default: true)

Whether the node should start replaying the video immediately. If `false`, replay only starts after a `std_msgs/Bool` with value `true` is sent to the node's `playing` topic.

~framerate (double, default: 30.0)

The rate at which video frames are published, in frames per second.

Library API

The cv_video::Video class connects to a ROS image topic and provides several methods to record, replay, and/or manipulate video streams and respective frames. See the header file include/video.h for usage instructions.

Action API

The cv_video::Camera class provides a C++ client API to the camcorder action server. See the header file include/camera.h for usage instructions.

About

Interface between OpenCV video facilities and ROS image transport library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published