You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the example launch file for a V4L USB camera (``usb_camera.launch.py``).
100
99
If the above parameter settings don't work, use the ``ros2 param dump <your_node_name>``
101
100
command to find out what the proper parameter path is.
102
101
103
102
### Subscriber (viewer)
104
103
105
-
The subscriber has only one parameter (``map.<some_encoding>``), which is the map between a codec and a comma-separated list of libav decoders that can be used for decoding.
106
-
If you don't set the map parameter, the Subscriber plugin will try to decode with a default set of libav decoders that support the appropriate codec.
107
-
The map is exposed as the ROS``ffmpeg.map`` parameter, which is prefixed by the image base name, e.g. ``camera.image_raw``.
108
-
The easiest way to find the exact naming of the parameter is to run the node and to use ``ros2 param list`` to find the ``ffmpeg.map`` parameter.
104
+
-``decoder_av_options`` comma-separated list of libav options to pass
105
+
to the decoder, like ``foo:bar,foobar:baz``. Default: empty string.
-``decoders.<codec>.<av_source_pixel_format>.<cv_bridge_target_format>.<original_ros_encoding>`` specifies the decoders to use for a given FFMPEGPacket encoding.
109
+
If no decoders are specified for the full encoding, a less specific parameter will be tested, i.e. ``decoders.<codec>.<av_source_pixel_format>.<cv_bridge_target_format>``, then ``decoders.<codec>.<av_source_pixel_format>``, and finally ``decoders.<codec>``.
110
+
If all parameters are found to be empty, the Subscriber plugin will try to decode with a default set of libav decoders that support the appropriate codec.
111
+
112
+
All parameters are prefixed again by the image topic and the transport, just like for the publisher node.
113
+
The easiest way to find the exact naming of the parameter is to run the node and to use ``ros2 param list`` to find the ``ffmpeg.decoders`` parameter.
109
114
Please also refer to the republisher launch script example.
110
115
111
116
Typically ROS2 parameters are passed to a node by *initializing* the parameters before launching the node, and the node then reads the parameter when it *declares* the parameter.
112
117
Unfortunately, this route is not available for the popular ``rqt`` based suite of image viewing tools such as ``rqt_image_view``, since ``rqt`` does not read command line arguments and therefore no parameters can be initialized. The only workaround there is to:
113
118
1) start e.g. ``rqt_image_view``
114
-
2) select the ffmpeg image transport in the drop down box. This will *declare* the ``map`` parameter so you can set it in the next step.
119
+
2) select the ffmpeg image transport in the drop down box. This will *declare* the ``decoders`` parameter so you can set it in the next step.
115
120
3) find the node name with ``ros2 node list`` and set the parameter using something like
116
-
``ros2 param set <name_of_your_viewer_node> camera.image_raw.ffmpeg.map.hevc hevc_cuvid``. This assumes your viewer node is subscribing to the topic ``/camera/image_raw/ffmpeg``.
117
-
4) again using the drop down box, switch to another image transport and back to ffmpeg. This will cause the ffmpeg transport plugin to apply the updated ``map`` parameter.
121
+
``ros2 param set <name_of_your_viewer_node> camera.image_raw.ffmpeg.decoders.hevc hevc_cuvid``. This assumes your viewer node is subscribing to the topic ``/camera/image_raw/ffmpeg``.
122
+
4) again using the drop down box, switch to another image transport and back to ffmpeg. This will cause the ffmpeg transport plugin to apply the updated ``decoders`` parameter.
118
123
119
124
### Republishing
120
125
@@ -127,19 +132,19 @@ For example to first try to decode incoming ``hevc`` packets with the ``hevc_cuv
127
132
128
133
- ROS 2 Humble:
129
134
```
130
-
ros2 run image_transport republish ffmpeg in/ffmpeg:=image_raw/ffmpeg raw out:=image_raw/uncompressed --ros-args -p "ffmpeg_image_transport.map.hevc:=hevc_cuvid,hevc"
135
+
ros2 run image_transport republish ffmpeg in/ffmpeg:=image_raw/ffmpeg raw out:=image_raw/uncompressed --ros-args -p "ffmpeg_image_transport.decoders.hevc:=hevc_cuvid,hevc"
0 commit comments