diff --git a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap index bf8ccb0..a65eb81 100644 --- a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap +++ b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap @@ -174,6 +174,29 @@ export type CompressedImage = { */ format: string; }; +", + "CompressedVideo" => "// Generated by https://github.com/foxglove/schemas + +import { Time } from "./Time"; + +/** A single frame of a compressed video bitstream */ +export type CompressedVideo = { + /** Timestamp of image */ + timestamp: Time; + + /** Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. */ + frame_id: string; + + /** Compressed video frame 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 (either a keyframe or delta frame). */ + data: Uint8Array; + + /** + * Video format + * + * Supported values: \`h264\` + */ + format: string; +}; ", "CylinderPrimitive" => "// Generated by https://github.com/foxglove/schemas @@ -999,6 +1022,7 @@ export * from "./CameraCalibration"; export * from "./CircleAnnotation"; export * from "./Color"; export * from "./CompressedImage"; +export * from "./CompressedVideo"; export * from "./CubePrimitive"; export * from "./CylinderPrimitive"; export * from "./FrameTransform"; diff --git a/internal/schemas.ts b/internal/schemas.ts index b538739..446eeca 100644 --- a/internal/schemas.ts +++ b/internal/schemas.ts @@ -790,6 +790,36 @@ const CompressedImage: FoxgloveMessageSchema = { ], }; +const CompressedVideo: FoxgloveMessageSchema = { + type: "message", + name: "CompressedVideo", + description: "A single frame of a compressed video bitstream", + fields: [ + { + name: "timestamp", + type: { type: "primitive", name: "time" }, + description: "Timestamp of image", + }, + { + name: "frame_id", + type: { type: "primitive", name: "string" }, + description: + "Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.", + }, + { + name: "data", + type: { type: "primitive", name: "bytes" }, + description: + "Compressed video frame 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 (either a keyframe or delta frame).", + }, + { + name: "format", + type: { type: "primitive", name: "string" }, + description: "Video format\n\nSupported values: `h264`", + }, + ], +}; + const RawImage: FoxgloveMessageSchema = { type: "message", name: "RawImage", @@ -1425,6 +1455,7 @@ export const foxgloveMessageSchemas = { CircleAnnotation, Color, CompressedImage, + CompressedVideo, CylinderPrimitive, CubePrimitive, FrameTransform, diff --git a/ros_foxglove_msgs/ros1/CompressedVideo.msg b/ros_foxglove_msgs/ros1/CompressedVideo.msg new file mode 100644 index 0000000..991c967 --- /dev/null +++ b/ros_foxglove_msgs/ros1/CompressedVideo.msg @@ -0,0 +1,18 @@ +# foxglove_msgs/CompressedVideo +# A single frame of a compressed video bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of image +time timestamp + +# Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. +string frame_id + +# Compressed video frame 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 (either a keyframe or delta frame). +uint8[] data + +# Video format +# +# Supported values: `h264` +string format diff --git a/ros_foxglove_msgs/ros2/CompressedVideo.msg b/ros_foxglove_msgs/ros2/CompressedVideo.msg new file mode 100644 index 0000000..03379ff --- /dev/null +++ b/ros_foxglove_msgs/ros2/CompressedVideo.msg @@ -0,0 +1,18 @@ +# foxglove_msgs/msg/CompressedVideo +# A single frame of a compressed video bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of image +builtin_interfaces/Time timestamp + +# Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. +string frame_id + +# Compressed video frame 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 (either a keyframe or delta frame). +uint8[] data + +# Video format +# +# Supported values: `h264` +string format diff --git a/schemas/README.md b/schemas/README.md index adb0ed5..05ba776 100644 --- a/schemas/README.md +++ b/schemas/README.md @@ -17,6 +17,7 @@ All schemas are generated from [schemas.ts](/internal/schemas.ts). - [CircleAnnotation](#circleannotation) - [Color](#color) - [CompressedImage](#compressedimage) +- [CompressedVideo](#compressedvideo) - [CubePrimitive](#cubeprimitive) - [CylinderPrimitive](#cylinderprimitive) - [FrameTransform](#frametransform) @@ -614,6 +615,72 @@ Supported values: `webp`, `jpeg`, `png` +## CompressedVideo + +A single frame of a compressed video bitstream + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fieldtypedescription
timestamp + +time + + + +Timestamp of image + +
frame_id + +string + + + +Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. + +
data + +bytes + + + +Compressed video frame 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 (either a keyframe or delta frame). + +
format + +string + + + +Video format + +Supported values: `h264` + +
+ ## CubePrimitive A primitive representing a cube or rectangular prism diff --git a/schemas/flatbuffer/CompressedVideo.fbs b/schemas/flatbuffer/CompressedVideo.fbs new file mode 100644 index 0000000..de3a482 --- /dev/null +++ b/schemas/flatbuffer/CompressedVideo.fbs @@ -0,0 +1,24 @@ +// Generated by https://github.com/foxglove/schemas + +include "Time.fbs"; + +namespace foxglove; + +/// A single frame of a compressed video bitstream +table CompressedVideo { + /// Timestamp of image + timestamp:Time; + + /// Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. + frame_id:string; + + /// Compressed video frame 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 (either a keyframe or delta frame). + data:[uint8]; + + /// Video format + /// + /// Supported values: `h264` + format:string; +} + +root_type CompressedVideo; diff --git a/schemas/jsonschema/CompressedVideo.json b/schemas/jsonschema/CompressedVideo.json new file mode 100644 index 0000000..21f167b --- /dev/null +++ b/schemas/jsonschema/CompressedVideo.json @@ -0,0 +1,37 @@ +{ + "title": "foxglove.CompressedVideo", + "description": "A single frame of a compressed video bitstream", + "$comment": "Generated by https://github.com/foxglove/schemas", + "type": "object", + "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of image" + }, + "frame_id": { + "type": "string", + "description": "Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image." + }, + "data": { + "type": "string", + "contentEncoding": "base64", + "description": "Compressed video frame 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 (either a keyframe or delta frame)." + }, + "format": { + "type": "string", + "description": "Video format\n\nSupported values: `h264`" + } + } +} diff --git a/schemas/jsonschema/index.ts b/schemas/jsonschema/index.ts index 20426c9..c168153 100644 --- a/schemas/jsonschema/index.ts +++ b/schemas/jsonschema/index.ts @@ -331,6 +331,44 @@ export const CompressedImage = { } }; +export const CompressedVideo = { + "title": "foxglove.CompressedVideo", + "description": "A single frame of a compressed video bitstream", + "$comment": "Generated by https://github.com/foxglove/schemas", + "type": "object", + "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of image" + }, + "frame_id": { + "type": "string", + "description": "Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image." + }, + "data": { + "type": "string", + "contentEncoding": "base64", + "description": "Compressed video frame 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 (either a keyframe or delta frame)." + }, + "format": { + "type": "string", + "description": "Video format\n\nSupported values: `h264`" + } + } +}; + export const CylinderPrimitive = { "title": "foxglove.CylinderPrimitive", "description": "A primitive representing a cylinder, elliptic cylinder, or truncated cone", diff --git a/schemas/proto/foxglove/CompressedVideo.proto b/schemas/proto/foxglove/CompressedVideo.proto new file mode 100644 index 0000000..9d61961 --- /dev/null +++ b/schemas/proto/foxglove/CompressedVideo.proto @@ -0,0 +1,24 @@ +// Generated by https://github.com/foxglove/schemas + +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; + +package foxglove; + +// A single frame of a compressed video bitstream +message CompressedVideo { + // Timestamp of image + google.protobuf.Timestamp timestamp = 1; + + // Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. + string frame_id = 2; + + // Compressed video frame 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 (either a keyframe or delta frame). + bytes data = 3; + + // Video format + // + // Supported values: `h264` + string format = 4; +} diff --git a/schemas/ros1/CompressedVideo.msg b/schemas/ros1/CompressedVideo.msg new file mode 100644 index 0000000..991c967 --- /dev/null +++ b/schemas/ros1/CompressedVideo.msg @@ -0,0 +1,18 @@ +# foxglove_msgs/CompressedVideo +# A single frame of a compressed video bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of image +time timestamp + +# Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. +string frame_id + +# Compressed video frame 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 (either a keyframe or delta frame). +uint8[] data + +# Video format +# +# Supported values: `h264` +string format diff --git a/schemas/ros2/CompressedVideo.msg b/schemas/ros2/CompressedVideo.msg new file mode 100644 index 0000000..03379ff --- /dev/null +++ b/schemas/ros2/CompressedVideo.msg @@ -0,0 +1,18 @@ +# foxglove_msgs/msg/CompressedVideo +# A single frame of a compressed video bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of image +builtin_interfaces/Time timestamp + +# Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. +string frame_id + +# Compressed video frame 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 (either a keyframe or delta frame). +uint8[] data + +# Video format +# +# Supported values: `h264` +string format diff --git a/schemas/typescript/CompressedVideo.ts b/schemas/typescript/CompressedVideo.ts new file mode 100644 index 0000000..bc3482a --- /dev/null +++ b/schemas/typescript/CompressedVideo.ts @@ -0,0 +1,22 @@ +// Generated by https://github.com/foxglove/schemas + +import { Time } from "./Time"; + +/** A single frame of a compressed video bitstream */ +export type CompressedVideo = { + /** Timestamp of image */ + timestamp: Time; + + /** Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. */ + frame_id: string; + + /** Compressed video frame 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 (either a keyframe or delta frame). */ + data: Uint8Array; + + /** + * Video format + * + * Supported values: `h264` + */ + format: string; +}; diff --git a/schemas/typescript/index.ts b/schemas/typescript/index.ts index f35731a..17d8755 100644 --- a/schemas/typescript/index.ts +++ b/schemas/typescript/index.ts @@ -3,6 +3,7 @@ export * from "./CameraCalibration"; export * from "./CircleAnnotation"; export * from "./Color"; export * from "./CompressedImage"; +export * from "./CompressedVideo"; export * from "./CubePrimitive"; export * from "./CylinderPrimitive"; export * from "./FrameTransform";