An image_transport plugin to tranport sensor_msg::Image data via VP8/VP9 encoded data stream within the WebM container.
WebM is an open source software project which is dedicated to develop a high-quality, open video format and codecs for the web that is freely available for anyone. It maintains the open video format which is widely supported by the modern browsers (Chromium, Firefox, Edge, etc.) and web engine based application runtimes (NW.js, Electron, etc.). The video format and the VPX encoders/decoders (including VP8, VP9 and VP10) are totally free to use without any potential proprietary license issue.
-
Follow the ROS Kinetic instruction in ROS Wiki to install the ROS Kinetic version onto your Ubuntu.
-
Then setup your ROS environment and create your ROS workspace. Follow the instruction here.
Before building the project, you need to install libvpx-dev
and libva-dev
to make it compile:
sudo apt-get install libvpx-dev libva-dev
All you need to is to clone this repository into the src
directory of your workspace and build it with catkin_make
:
cd ~/catkin_ws/src
git clone <this_repository_url>
cd ..
catkin_make
Firstly your ROS node should publish the sensor_msg::Image
message through the image_transport. For more details on how to write your codes to publish through image_transport, please refer to the image transport wiki.
After you successfully hook up the sensor_msg::Image
message with image_transport, the Image Transport for VPx plugin will be loaded automatically by image_transport and the WebM/VPX encoded data stream will be published at <image_topic_name>/vpx
.
As browser / web application runtime has the ability to decode the WebM/VPX data stream, we can feed the data stream directly into the HTML5 VideoElement by creating a MediaSource for it and append the WebM/VPX encoded data into the SourceBuffer. You can follow the instruction of the sample here to create a NW.js application to display the Image data.
Image Transport for VPx project is available under the BSD license. See the LICENSE file for more information.