README.md

November 6, 2022 ยท View on GitHub

h264_image_transport build status

Adds H264 decoding to ROS2 image transport. Also includes a simple node to copy H264 packets from a video4linux camera.

Possible future work: add H264 encoder

Example usage

Command line:

ros2 run image_transport republish h264 raw --ros-args -r in/h264:=/image_raw/h264 -r out:=/repub_raw

Launch file:

ros2 launch h264_image_transport example_launch.py

h264_cam_node parameters

ParameterTypeDefaultNotes
input_fnstring/dev/video2Can be any ffmpeg format
fpsstring30Desired frame rate
sizestring800x600Width by height
frame_idstringcamera_frameCamera frame ID
camera_info_pathstringinfo.iniPath to camera info file

h264_cam_node topics

TopicMessageNotes
image_raw/h264h264_msgs::msg::PacketH264 packet
camera_infosensor_msgs::msg::CameraInfoCamera info message

Requirements

Tested on ROS2 Foxy, Galactic and Humble.

Requires libavdevice, libavformat, libavcodec, libavutil, libswscale.

Here's one way to satisfy these requirements:

sudo apt install libavdevice-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev

Note: rosdep won't find keys for most of these libraries so package.xml declares dependencies on ffmpeg and libavdevice-dev. Strictly speaking ffmpeg is not required.