@fleetless/contracts 15.3.0 → 15.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,33 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [15.4.0] — 2026-11-13
13
+
14
+ ### Changed
15
+
16
+ - **A hardware encoder takes no camera of odd size**
17
+ (fleetless/fleetless#1143). With `live.encoder` present and not
18
+ `software`, `robotConfigDoc` refuses every camera whose `width` or `height`
19
+ is odd, passthrough cameras included: one issue per odd key, at
20
+ `cameras.<slug>.width` or `cameras.<slug>.height`, with zod's `custom` code
21
+ and a sentence that names the setting, the odd value and the two ways out.
22
+ Such a camera was accepted before and gave no picture: H.264 as the bridge
23
+ sends it has no odd size, in a hardware encoder or in the software H.264 it
24
+ falls back to. `software` and an absent key accept an odd size as before.
25
+ The rule spans two sections, so it is a refinement on the document and not
26
+ in the JSON Schema export. It is reported beside the document's other
27
+ refusals, except a fraction on an integer key anywhere in the document,
28
+ which zod treats as final: the finding then arrives once the fraction is
29
+ fixed.
30
+ - With that refinement on it, zod refuses to derive from `robotConfigDoc`:
31
+ `.pick()`, `.omit()`, `.partial()`, `.merge()` and `.extend()` of a key it
32
+ already has throw at runtime, and the type does not show it. `.shape`,
33
+ `.safeExtend()` and `.extend()` with a new key still work. The type and
34
+ the JSON Schema are unchanged.
35
+ - The descriptions of a camera's `width` and `height` and of `live.encoder`
36
+ say the rule. The description of `vaapi` names three elements in the order
37
+ the bridge tries them: `vah264enc`, `vah264lpenc`, `vaapih264enc`.
38
+
12
39
  ## [15.3.0] — 2026-11-13
13
40
 
14
41
  ### Added
@@ -32314,7 +32314,7 @@
32314
32314
  "type": "integer",
32315
32315
  "exclusiveMinimum": 0,
32316
32316
  "maximum": 7680,
32317
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
32317
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
32318
32318
  "examples": [
32319
32319
  1280
32320
32320
  ]
@@ -32323,7 +32323,7 @@
32323
32323
  "type": "integer",
32324
32324
  "exclusiveMinimum": 0,
32325
32325
  "maximum": 4320,
32326
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
32326
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
32327
32327
  "examples": [
32328
32328
  720
32329
32329
  ]
@@ -32565,7 +32565,7 @@
32565
32565
  "maximum": 1350
32566
32566
  },
32567
32567
  "encoder": {
32568
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
32568
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
32569
32569
  "type": "string",
32570
32570
  "enum": [
32571
32571
  "software",
@@ -33753,7 +33753,7 @@
33753
33753
  "type": "integer",
33754
33754
  "exclusiveMinimum": 0,
33755
33755
  "maximum": 7680,
33756
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
33756
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
33757
33757
  "examples": [
33758
33758
  1280
33759
33759
  ]
@@ -33762,7 +33762,7 @@
33762
33762
  "type": "integer",
33763
33763
  "exclusiveMinimum": 0,
33764
33764
  "maximum": 4320,
33765
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
33765
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
33766
33766
  "examples": [
33767
33767
  720
33768
33768
  ]
@@ -34004,7 +34004,7 @@
34004
34004
  "maximum": 1350
34005
34005
  },
34006
34006
  "encoder": {
34007
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
34007
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
34008
34008
  "type": "string",
34009
34009
  "enum": [
34010
34010
  "software",
@@ -1668,7 +1668,7 @@
1668
1668
  "type": "integer",
1669
1669
  "exclusiveMinimum": 0,
1670
1670
  "maximum": 7680,
1671
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
1671
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1672
1672
  "examples": [
1673
1673
  1280
1674
1674
  ]
@@ -1677,7 +1677,7 @@
1677
1677
  "type": "integer",
1678
1678
  "exclusiveMinimum": 0,
1679
1679
  "maximum": 4320,
1680
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
1680
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1681
1681
  "examples": [
1682
1682
  720
1683
1683
  ]
@@ -2086,12 +2086,12 @@
2086
2086
  "maximum": 1350
2087
2087
  },
2088
2088
  "encoder": {
2089
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2089
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2090
2090
  "enumDescriptions": [
2091
2091
  "The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.",
2092
2092
  "Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.",
2093
2093
  "NVIDIA. On a Jetson the board's encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.",
2094
- "Intel and AMD graphics through VA-API: `vah264enc` where the installed GStreamer has it, else `vaapih264enc`.",
2094
+ "Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.",
2095
2095
  "A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software."
2096
2096
  ],
2097
2097
  "type": "string",
@@ -1661,7 +1661,7 @@
1661
1661
  "type": "integer",
1662
1662
  "exclusiveMinimum": 0,
1663
1663
  "maximum": 7680,
1664
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
1664
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1665
1665
  "examples": [
1666
1666
  1280
1667
1667
  ]
@@ -1670,7 +1670,7 @@
1670
1670
  "type": "integer",
1671
1671
  "exclusiveMinimum": 0,
1672
1672
  "maximum": 4320,
1673
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
1673
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1674
1674
  "examples": [
1675
1675
  720
1676
1676
  ]
@@ -2079,12 +2079,12 @@
2079
2079
  "maximum": 1350
2080
2080
  },
2081
2081
  "encoder": {
2082
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2082
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2083
2083
  "enumDescriptions": [
2084
2084
  "The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.",
2085
2085
  "Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.",
2086
2086
  "NVIDIA. On a Jetson the board's encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.",
2087
- "Intel and AMD graphics through VA-API: `vah264enc` where the installed GStreamer has it, else `vaapih264enc`.",
2087
+ "Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.",
2088
2088
  "A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software."
2089
2089
  ],
2090
2090
  "type": "string",
@@ -1699,7 +1699,7 @@
1699
1699
  "type": "integer",
1700
1700
  "exclusiveMinimum": 0,
1701
1701
  "maximum": 7680,
1702
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
1702
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1703
1703
  "examples": [
1704
1704
  1280
1705
1705
  ]
@@ -1708,7 +1708,7 @@
1708
1708
  "type": "integer",
1709
1709
  "exclusiveMinimum": 0,
1710
1710
  "maximum": 4320,
1711
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
1711
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1712
1712
  "examples": [
1713
1713
  720
1714
1714
  ]
@@ -2117,12 +2117,12 @@
2117
2117
  "maximum": 1350
2118
2118
  },
2119
2119
  "encoder": {
2120
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2120
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2121
2121
  "enumDescriptions": [
2122
2122
  "The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.",
2123
2123
  "Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.",
2124
2124
  "NVIDIA. On a Jetson the board's encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.",
2125
- "Intel and AMD graphics through VA-API: `vah264enc` where the installed GStreamer has it, else `vaapih264enc`.",
2125
+ "Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.",
2126
2126
  "A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software."
2127
2127
  ],
2128
2128
  "type": "string",
@@ -1656,7 +1656,7 @@
1656
1656
  "type": "integer",
1657
1657
  "exclusiveMinimum": 0,
1658
1658
  "maximum": 7680,
1659
- "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size.",
1659
+ "description": "The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1660
1660
  "examples": [
1661
1661
  1280
1662
1662
  ]
@@ -1665,7 +1665,7 @@
1665
1665
  "type": "integer",
1666
1666
  "exclusiveMinimum": 0,
1667
1667
  "maximum": 4320,
1668
- "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size.",
1668
+ "description": "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
1669
1669
  "examples": [
1670
1670
  720
1671
1671
  ]
@@ -2074,12 +2074,12 @@
2074
2074
  "maximum": 1350
2075
2075
  },
2076
2076
  "encoder": {
2077
- "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2077
+ "description": "What encodes live video on the robot. `software` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but `software` every camera's `width` and `height` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter `live.encoder`; without either, the bridge uses `software`. A change holds from the next live start; a running stream keeps its encoder.",
2078
2078
  "enumDescriptions": [
2079
2079
  "The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.",
2080
2080
  "Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.",
2081
2081
  "NVIDIA. On a Jetson the board's encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.",
2082
- "Intel and AMD graphics through VA-API: `vah264enc` where the installed GStreamer has it, else `vaapih264enc`.",
2082
+ "Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.",
2083
2083
  "A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software."
2084
2084
  ],
2085
2085
  "type": "string",
@@ -89,9 +89,9 @@ export declare const collectionExportQuery: z.ZodObject<{
89
89
  true: "true";
90
90
  false: "false";
91
91
  }>>;
92
- search: z.ZodOptional<z.ZodString>;
93
- filter: z.ZodOptional<z.ZodString>;
94
92
  sort: z.ZodOptional<z.ZodString>;
93
+ filter: z.ZodOptional<z.ZodString>;
94
+ search: z.ZodOptional<z.ZodString>;
95
95
  robot: z.ZodOptional<z.ZodUUID>;
96
96
  format: z.ZodEnum<{
97
97
  json: "json";
package/dist/config.js CHANGED
@@ -42,6 +42,10 @@ import { ENTRY_KINDS, roleRef } from './rights.js';
42
42
  * the index of declared names that `messages:` and each entry's
43
43
  * `parameters:` build together.
44
44
  *
45
+ * One rule across sections is decided here all the same, and carries none of
46
+ * the thirteen codes: a camera of odd size under a hardware `live.encoder`
47
+ * (`refuseOddSizes`, whose comment says why it sits on the document).
48
+ *
45
49
  * `nested_message_reference` is the one worth naming explicitly, because it
46
50
  * looks decidable here and is: a `messages:` entry whose whole body is
47
51
  * `'${name}'` is a nested reference, full stop. It is the cloud's anyway, so
@@ -1866,11 +1870,11 @@ export const cameraConfig = strictObject({
1866
1870
  description: 'Where this camera\'s frames come from. `kind` picks one of four sources and fixes which other fields the source may carry, so an impossible camera is unrepresentable rather than merely invalid — there is no way to write an RTSP camera with a ROS topic.',
1867
1871
  }),
1868
1872
  width: z.number().int().positive().max(7680).meta({
1869
- description: 'The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer\'s request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream\'s own size.',
1873
+ description: 'The width the bridge scales frames to before sending, in pixels — what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer\'s request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream\'s own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.',
1870
1874
  examples: [1280],
1871
1875
  }),
1872
1876
  height: z.number().int().positive().max(4320).meta({
1873
- description: 'The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream\'s own size.',
1877
+ description: 'The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this — its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream\'s own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.',
1874
1878
  examples: [720],
1875
1879
  }),
1876
1880
  fps: z.number().int().positive().max(60).meta({
@@ -2033,16 +2037,83 @@ export const liveSection = strictObject({
2033
2037
  examples: [LIVE_DEFAULTS.max_packet_bytes],
2034
2038
  }),
2035
2039
  encoder: liveEncoder.optional().meta({
2036
- description: `What encodes live video on the robot. \`software\` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter \`live.encoder\`; without either, the bridge uses \`${LIVE_DEFAULTS.encoder}\`. A change holds from the next live start; a running stream keeps its encoder.`,
2040
+ description: `What encodes live video on the robot. \`software\` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but \`software\` every camera's \`width\` and \`height\` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter \`live.encoder\`; without either, the bridge uses \`${LIVE_DEFAULTS.encoder}\`. A change holds from the next live start; a running stream keeps its encoder.`,
2037
2041
  enumDescriptions: describeValues(liveEncoder.options, {
2038
2042
  software: 'The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.',
2039
2043
  auto: 'Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.',
2040
2044
  nvenc: 'NVIDIA. On a Jetson the board\'s encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.',
2041
- vaapi: 'Intel and AMD graphics through VA-API: `vah264enc` where the installed GStreamer has it, else `vaapih264enc`.',
2045
+ vaapi: 'Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.',
2042
2046
  v4l2: 'A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software.',
2043
2047
  }),
2044
2048
  }),
2045
2049
  });
2050
+ /**
2051
+ * The values of `live.encoder` that send H.264 and nothing else: every one
2052
+ * but `software`. Read from the tuple, so a sixth hardware name is covered by
2053
+ * the rule below the moment it is in the enum.
2054
+ */
2055
+ const H264_ONLY_ENCODERS = new Set(LIVE_ENCODERS.filter((encoder) => encoder !== 'software'));
2056
+ /**
2057
+ * The refusal for one odd key, in one sentence: the setting, the odd value
2058
+ * and the two ways out. A bridge that meets the same camera through its ROS
2059
+ * parameter refuses the live start in the same words, of the whole size.
2060
+ */
2061
+ const oddSizeMessage = (encoder, key, value) => `With live.encoder: ${encoder} the bridge sends H.264, which takes no odd ${key}: set an even ${key} instead of ${value}, or live.encoder: software.`;
2062
+ const isMapping = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
2063
+ const samePath = (a, b) => a.length === b.length && a.every((segment, index) => segment === b[index]);
2064
+ /**
2065
+ * **A hardware encoder takes no camera of odd size.** With any `live.encoder`
2066
+ * but `software` the bridge offers H.264 alone, from the chip or from the
2067
+ * software H.264 it falls back to, and H.264 as the bridge sends it (4:2:0)
2068
+ * has no odd width or height. Such a camera used to be accepted, failed in
2069
+ * every chain and in the fallback, and gave its viewer no picture.
2070
+ *
2071
+ * One issue per odd key, at `cameras.<slug>.width` or `.height`. Every camera
2072
+ * counts, passthrough ones included: a passthrough camera's size must equal
2073
+ * its stream's, and a 4:2:0 H.264 stream has no odd size either, so one rule
2074
+ * without an exception says the same thing. `software` and an absent key
2075
+ * change nothing; the media server may pick VP8 there.
2076
+ *
2077
+ * **It spans two sections, so it is on the document**, and like every
2078
+ * `superRefine` it is not in the JSON Schema export: an editor learns it from
2079
+ * the findings of a validation, and the descriptions of `width`, `height` and
2080
+ * `live.encoder` say it in words. The issue keeps zod's own code, as
2081
+ * `low_bandwidth.exit_lag_ms` does: the format names no code for it.
2082
+ *
2083
+ * **It runs beside the document's other refusals, with one exception.** Zod
2084
+ * skips a refinement once anything in the value is refused, which at the root
2085
+ * means anywhere in the file: a typo three sections away would hide this
2086
+ * finding until it was fixed. `when` lets it run whenever the document is a
2087
+ * mapping, so the value it reads may be half-parsed, and it reads it as such:
2088
+ * nothing unless `live.encoder` is one of the hardware values, nothing for a
2089
+ * camera that is not a mapping, and nothing for a key that is not an integer
2090
+ * or already carries a refusal of its own, which is then the one finding that
2091
+ * key has. The exception is a fraction on an integer key anywhere in the
2092
+ * document: zod treats that refusal as final and runs no `when` check after
2093
+ * it, so this finding arrives once the fraction is fixed. Working around it
2094
+ * would take a `preprocess` or a pipe, and `robotConfigDoc` would stop being
2095
+ * an object schema.
2096
+ */
2097
+ function refuseOddSizes(doc, ctx) {
2098
+ if (!isMapping(doc) || !isMapping(doc.live) || !isMapping(doc.cameras))
2099
+ return;
2100
+ const encoder = doc.live.encoder;
2101
+ if (typeof encoder !== 'string' || !H264_ONLY_ENCODERS.has(encoder))
2102
+ return;
2103
+ for (const [slug, camera] of Object.entries(doc.cameras)) {
2104
+ if (!isMapping(camera))
2105
+ continue;
2106
+ for (const key of ['width', 'height']) {
2107
+ const value = camera[key];
2108
+ const path = ['cameras', slug, key];
2109
+ if (typeof value !== 'number' || !Number.isInteger(value) || value % 2 === 0)
2110
+ continue;
2111
+ if (ctx.issues.some((issue) => samePath(issue.path ?? [], path)))
2112
+ continue;
2113
+ ctx.addIssue({ code: 'custom', path, message: oddSizeMessage(encoder, key, value) });
2114
+ }
2115
+ }
2116
+ }
2046
2117
  /**
2047
2118
  * The format version of a `fleetless.yaml`. Deliberately not called
2048
2119
  * `version`: the console counts published states with "v12 → v13", and two
@@ -2194,7 +2265,7 @@ export const robotConfigDoc = strictObject({
2194
2265
  body: { max_packet_bytes: LIVE_DEFAULTS.max_packet_bytes },
2195
2266
  }],
2196
2267
  }),
2197
- });
2268
+ }).superRefine(refuseOddSizes, { when: (payload) => isMapping(payload.value) });
2198
2269
  /**
2199
2270
  * One thing the cloud has to say about a configuration: the field, and the
2200
2271
  * rule it violates.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "15.3.0",
3
+ "version": "15.4.0",
4
4
  "description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dehne Robotik GmbH",