Skip to main content

CompressedVideo

A single frame of a compressed video bitstream

Panel Support

CompressedVideo is used in the 3D Panel and Image Panel.

Data Structure

FieldTypeDescription
timestamptimeTimestamp of the video frame
frame_idstringReference coordinate system of the video
databytesCompressed video frame data
formatstringVideo format

frame_id

The origin of the frame is the optical center of the camera. +x points to the right side of the video, +y points downward, and +z points into the video plane.

data

For packet-based video codecs, this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (key frame or incremental frame). Note: Foxglove does not support video streams that contain B-frames because they require lookahead.

Specifically, the requirements for different format values are as follows:

  • h264
    • Data using Annex B format
    • Each CompressedVideo message should contain enough NAL units to decode exactly one video frame
    • Each message containing a key frame (IDR) must also include the SPS NAL unit

format

Supported values: h264.

Note: Compressed video support is affected by hardware limitations and patent licensing, so not all platforms support all encodings.

Reference Implementation

The visualization data structure is framework-independent and can be implemented using any supported message encoding:

EncodingData Structure
ROS 1foxglove_msgs/CompressedVideo
ROS 2foxglove_msgs/msg/CompressedVideo
JSONfoxglove.CompressedVideo
Protobuffoxglove.CompressedVideo
FlatBuffersfoxglove.CompressedVideo
OMG IDLfoxglove::CompressedVideo

You must use the data structure names specified above for the visualization to recognize the data structure.