pymcap-cli 0.2.0__tar.gz → 0.3.0__tar.gz
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.
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/PKG-INFO +112 -233
- pymcap_cli-0.3.0/README.md +332 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/pyproject.toml +1 -1
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/info_cmd.py +2 -2
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/info_data.py +17 -105
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/info_link.py +35 -41
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/display_utils.py +148 -46
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/info_types.py +27 -98
- pymcap_cli-0.2.0/README.md +0 -453
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/__init__.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cli.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/__init__.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/_run_processor.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/cat_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/compress_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/convert_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/du_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/filter_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/info_json_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/list_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/merge_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/process_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/rechunk_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/records_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/recover_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/recover_inplace_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/roscompress_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/tftree_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/topic_chunks_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/cmd/video_cmd.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/debug_wrapper.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/http_utils.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/image_utils.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/input_handler.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/mcap_processor.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/msg_resolver.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/osc_utils.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/processors.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/py.typed +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/types_manual.py +0 -0
- {pymcap_cli-0.2.0 → pymcap_cli-0.3.0}/src/pymcap_cli/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pymcap-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: High-performance Python CLI for MCAP file processing with advanced recovery, filtering, and optimization capabilities
|
|
5
5
|
Keywords: mcap,cli,robotics,ros,ros2,recovery,filtering,compression
|
|
6
6
|
Author: Marko Bausch
|
|
@@ -42,6 +42,12 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
|
|
43
43
|
A high-performance Python CLI for MCAP file processing with advanced recovery, filtering, and optimization capabilities.
|
|
44
44
|
|
|
45
|
+
<picture>
|
|
46
|
+
<source media="(prefers-color-scheme: light)" srcset="vhs/info-light.gif">
|
|
47
|
+
<source media="(prefers-color-scheme: dark)" srcset="vhs/info.gif">
|
|
48
|
+
<img src="vhs/info.gif" alt="pymcap-cli info" />
|
|
49
|
+
</picture>
|
|
50
|
+
|
|
45
51
|
## Installation
|
|
46
52
|
|
|
47
53
|
```bash
|
|
@@ -57,66 +63,55 @@ uv add pymcap-cli[video]
|
|
|
57
63
|
|
|
58
64
|
## Why pymcap-cli over the official Go CLI?
|
|
59
65
|
|
|
60
|
-
- **Advanced Recovery
|
|
61
|
-
- **Smart Chunk Copying
|
|
62
|
-
- **Unified Processing
|
|
63
|
-
- **Precise Filtering
|
|
64
|
-
- **Rich
|
|
65
|
-
- **Robust Error Handling
|
|
66
|
+
- **Advanced Recovery** — handles corrupt MCAP files with intelligent chunk-level recovery and MessageIndex validation
|
|
67
|
+
- **Smart Chunk Copying** — fast chunk copying without decompression when possible, up to 10x faster for filtering operations
|
|
68
|
+
- **Unified Processing** — single `process` command combines recovery + filtering + compression in one optimized pass
|
|
69
|
+
- **Precise Filtering** — regex topic filtering, time range filtering, and content type filtering with deferred schema/channel writing
|
|
70
|
+
- **Rich Terminal Output** — colored topics, Unicode distribution histograms, tree views, and responsive layouts
|
|
71
|
+
- **Robust Error Handling** — graceful degradation with detailed error reporting and recovery statistics
|
|
66
72
|
|
|
67
|
-
##
|
|
73
|
+
## Commands
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
# Get file information
|
|
71
|
-
pymcap-cli info data.mcap
|
|
75
|
+
### `info` — File Information
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
pymcap-cli recover corrupted.mcap -o fixed.mcap
|
|
77
|
+
Display detailed MCAP file information including schemas, channels, message counts, time ranges, and per-topic distribution histograms.
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
pymcap-cli
|
|
78
|
-
|
|
79
|
-
# Rechunk by topic patterns
|
|
80
|
-
pymcap-cli rechunk data.mcap -o rechunked.mcap -p "/camera.*" -p "/lidar.*"
|
|
81
|
-
|
|
82
|
-
# Show disk usage breakdown
|
|
83
|
-
pymcap-cli du large.mcap
|
|
84
|
-
|
|
85
|
-
# Compress files
|
|
86
|
-
pymcap-cli compress input.mcap -o compressed.mcap --compression lz4
|
|
79
|
+
```bash
|
|
80
|
+
pymcap-cli info data.mcap
|
|
87
81
|
```
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### `info` - File Information
|
|
83
|
+
Use `--tree` to group topics into a hierarchical tree view:
|
|
92
84
|
|
|
93
|
-
|
|
85
|
+
<picture>
|
|
86
|
+
<source media="(prefers-color-scheme: light)" srcset="vhs/info-tree-light.gif">
|
|
87
|
+
<source media="(prefers-color-scheme: dark)" srcset="vhs/info-tree.gif">
|
|
88
|
+
<img src="vhs/info-tree.gif" alt="pymcap-cli info --tree" />
|
|
89
|
+
</picture>
|
|
94
90
|
|
|
95
91
|
```bash
|
|
96
|
-
#
|
|
97
|
-
pymcap-cli info data.mcap
|
|
98
|
-
|
|
99
|
-
# Multiple files (displays each file separately)
|
|
92
|
+
# Multiple files
|
|
100
93
|
pymcap-cli info file1.mcap file2.mcap file3.mcap
|
|
101
94
|
|
|
102
|
-
# JSON output
|
|
95
|
+
# JSON output
|
|
103
96
|
pymcap-cli info-json data.mcap
|
|
104
|
-
|
|
105
|
-
# JSON output for multiple files (returns array)
|
|
106
|
-
pymcap-cli info-json file1.mcap file2.mcap
|
|
107
97
|
```
|
|
108
98
|
|
|
109
|
-
### `cat`
|
|
99
|
+
### `cat` — Stream Messages
|
|
110
100
|
|
|
111
101
|
Stream MCAP messages to stdout. Outputs as Rich tables when interactive, JSONL when piped.
|
|
112
102
|
|
|
103
|
+
Use `--query` to extract nested fields from deeply structured ROS messages with JSONPath-like syntax:
|
|
104
|
+
|
|
105
|
+
<picture>
|
|
106
|
+
<source media="(prefers-color-scheme: light)" srcset="vhs/cat-query-light.gif">
|
|
107
|
+
<source media="(prefers-color-scheme: dark)" srcset="vhs/cat-query.gif">
|
|
108
|
+
<img src="vhs/cat-query.gif" alt="pymcap-cli cat --query" />
|
|
109
|
+
</picture>
|
|
110
|
+
|
|
113
111
|
```bash
|
|
114
|
-
# Display messages in a table
|
|
112
|
+
# Display messages in a table
|
|
115
113
|
pymcap-cli cat recording.mcap
|
|
116
114
|
|
|
117
|
-
# Pipe to file as JSONL
|
|
118
|
-
pymcap-cli cat recording.mcap > messages.jsonl
|
|
119
|
-
|
|
120
115
|
# Filter specific topics
|
|
121
116
|
pymcap-cli cat recording.mcap --topics /camera/image
|
|
122
117
|
|
|
@@ -131,45 +126,38 @@ pymcap-cli cat recording.mcap --query '/odom.pose.position.x'
|
|
|
131
126
|
|
|
132
127
|
# Filter array elements
|
|
133
128
|
pymcap-cli cat recording.mcap --query '/detections.objects[:]{confidence>0.8}'
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### `recover` - Advanced Recovery
|
|
137
|
-
|
|
138
|
-
Recover data from potentially corrupt MCAP files with intelligent error handling.
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# Basic recovery
|
|
142
|
-
pymcap-cli recover corrupt.mcap -o fixed.mcap
|
|
143
129
|
|
|
144
|
-
#
|
|
145
|
-
pymcap-cli
|
|
130
|
+
# Pipe to file as JSONL
|
|
131
|
+
pymcap-cli cat recording.mcap > messages.jsonl
|
|
146
132
|
```
|
|
147
133
|
|
|
148
|
-
### `
|
|
134
|
+
### `tftree` — TF Transform Tree
|
|
149
135
|
|
|
150
|
-
|
|
136
|
+
Visualize the ROS TF transform tree with colored static/dynamic transforms, translation and rotation values.
|
|
151
137
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
138
|
+
<picture>
|
|
139
|
+
<source media="(prefers-color-scheme: light)" srcset="vhs/tftree-light.gif">
|
|
140
|
+
<source media="(prefers-color-scheme: dark)" srcset="vhs/tftree.gif">
|
|
141
|
+
<img src="vhs/tftree.gif" alt="pymcap-cli tftree" />
|
|
142
|
+
</picture>
|
|
155
143
|
|
|
156
|
-
|
|
157
|
-
|
|
144
|
+
```bash
|
|
145
|
+
# Show complete TF tree (both /tf and /tf_static)
|
|
146
|
+
pymcap-cli tftree data.mcap
|
|
158
147
|
|
|
159
|
-
#
|
|
160
|
-
pymcap-cli
|
|
148
|
+
# Show only static transforms
|
|
149
|
+
pymcap-cli tftree data.mcap --static-only
|
|
161
150
|
```
|
|
162
151
|
|
|
163
|
-
### `process`
|
|
152
|
+
### `process` — Unified Processing
|
|
164
153
|
|
|
165
|
-
The most powerful command
|
|
154
|
+
The most powerful command — combines recovery, filtering, and optimization in a single pass.
|
|
166
155
|
|
|
167
156
|
```bash
|
|
168
157
|
# Filter by topic regex
|
|
169
158
|
pymcap-cli process data.mcap -o filtered.mcap -y "/camera.*" -y "/lidar.*"
|
|
170
159
|
|
|
171
160
|
# Time range filtering (nanoseconds or RFC3339)
|
|
172
|
-
pymcap-cli process data.mcap -o subset.mcap -S 1640995200000000000 -E 1640995260000000000
|
|
173
161
|
pymcap-cli process data.mcap -o subset.mcap -S "2022-01-01T00:00:00Z" -E "2022-01-01T01:00:00Z"
|
|
174
162
|
|
|
175
163
|
# Exclude topics and metadata
|
|
@@ -182,7 +170,34 @@ pymcap-cli process zstd.mcap -o lz4.mcap --compression lz4 -y "/important.*"
|
|
|
182
170
|
pymcap-cli process corrupt.mcap -o recovered.mcap -y "/camera.*" --recovery-mode
|
|
183
171
|
```
|
|
184
172
|
|
|
185
|
-
### `
|
|
173
|
+
### `recover` — Advanced Recovery
|
|
174
|
+
|
|
175
|
+
Recover data from potentially corrupt MCAP files with intelligent error handling.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Basic recovery
|
|
179
|
+
pymcap-cli recover corrupt.mcap -o fixed.mcap
|
|
180
|
+
|
|
181
|
+
# Force chunk decoding for maximum recovery
|
|
182
|
+
pymcap-cli recover corrupt.mcap -o fixed.mcap --always-decode-chunk
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `recover-inplace` — In-Place Recovery
|
|
186
|
+
|
|
187
|
+
Rebuild an MCAP file's summary and footer in place without creating a new file.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Rebuild summary/footer in place
|
|
191
|
+
pymcap-cli recover-inplace data.mcap
|
|
192
|
+
|
|
193
|
+
# With exact size calculation
|
|
194
|
+
pymcap-cli recover-inplace data.mcap --exact-sizes
|
|
195
|
+
|
|
196
|
+
# Skip confirmation prompt
|
|
197
|
+
pymcap-cli recover-inplace data.mcap --force
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### `merge` — Merge Files
|
|
186
201
|
|
|
187
202
|
Merge multiple MCAP files chronologically into a single output file.
|
|
188
203
|
|
|
@@ -197,7 +212,7 @@ pymcap-cli merge *.mcap -o all_recordings.mcap --compression lz4
|
|
|
197
212
|
pymcap-cli merge file1.mcap file2.mcap -o merged.mcap --metadata exclude
|
|
198
213
|
```
|
|
199
214
|
|
|
200
|
-
### `convert`
|
|
215
|
+
### `convert` — Convert DB3 to MCAP
|
|
201
216
|
|
|
202
217
|
Convert ROS2 DB3 (SQLite) bag files to MCAP format.
|
|
203
218
|
|
|
@@ -210,43 +225,25 @@ pymcap-cli convert input.db3 -o output.mcap --distro jazzy
|
|
|
210
225
|
|
|
211
226
|
# With custom message definitions
|
|
212
227
|
pymcap-cli convert input.db3 -o output.mcap --extra-path /path/to/msgs
|
|
213
|
-
|
|
214
|
-
# Multiple custom paths
|
|
215
|
-
pymcap-cli convert input.db3 -o output.mcap \
|
|
216
|
-
--extra-path /path/to/msgs1 \
|
|
217
|
-
--extra-path /path/to/msgs2
|
|
218
228
|
```
|
|
219
229
|
|
|
220
|
-
### `rechunk`
|
|
230
|
+
### `rechunk` — Topic-Based Rechunking
|
|
221
231
|
|
|
222
|
-
Reorganize MCAP messages into separate chunk groups based on topic patterns
|
|
232
|
+
Reorganize MCAP messages into separate chunk groups based on topic patterns for optimized playback.
|
|
223
233
|
|
|
224
234
|
```bash
|
|
225
235
|
# Group camera and lidar topics into separate chunks
|
|
226
236
|
pymcap-cli rechunk data.mcap -o rechunked.mcap -p "/camera.*" -p "/lidar.*"
|
|
227
237
|
|
|
228
|
-
# Multiple patterns
|
|
238
|
+
# Multiple patterns — each gets its own chunk group
|
|
229
239
|
pymcap-cli rechunk data.mcap -o rechunked.mcap \
|
|
230
240
|
-p "/camera/front.*" \
|
|
231
241
|
-p "/camera/rear.*" \
|
|
232
242
|
-p "/lidar.*" \
|
|
233
243
|
-p "/radar.*"
|
|
234
|
-
|
|
235
|
-
# With custom chunk size and compression
|
|
236
|
-
pymcap-cli rechunk data.mcap -o rechunked.mcap \
|
|
237
|
-
-p "/high_freq.*" \
|
|
238
|
-
--chunk-size 8388608 \
|
|
239
|
-
--compression lz4
|
|
240
244
|
```
|
|
241
245
|
|
|
242
|
-
|
|
243
|
-
- Messages are grouped by the first matching pattern (first match wins)
|
|
244
|
-
- Each pattern gets its own chunk group that can span multiple chunks
|
|
245
|
-
- Topics not matching any pattern go into a separate "unmatched" group
|
|
246
|
-
- Messages within each group preserve their original order
|
|
247
|
-
- Useful for optimizing access patterns when different topics are read independently
|
|
248
|
-
|
|
249
|
-
### `filter` - Topic Filtering
|
|
246
|
+
### `filter` — Topic Filtering
|
|
250
247
|
|
|
251
248
|
Filter messages by topic patterns (simpler version of `process`).
|
|
252
249
|
|
|
@@ -258,17 +255,16 @@ pymcap-cli filter data.mcap -o filtered.mcap --include-topics "/camera/image" "/
|
|
|
258
255
|
pymcap-cli filter data.mcap -o filtered.mcap --exclude-topics "/debug.*" "/test.*"
|
|
259
256
|
```
|
|
260
257
|
|
|
261
|
-
### `compress`
|
|
258
|
+
### `compress` — Compression Tool
|
|
262
259
|
|
|
263
260
|
Change MCAP file compression.
|
|
264
261
|
|
|
265
262
|
```bash
|
|
266
|
-
# Compress with different algorithms
|
|
267
263
|
pymcap-cli compress input.mcap -o output.mcap --compression zstd
|
|
268
264
|
pymcap-cli compress input.mcap -o output.mcap --compression lz4
|
|
269
265
|
```
|
|
270
266
|
|
|
271
|
-
### `du`
|
|
267
|
+
### `du` — Disk Usage Analysis
|
|
272
268
|
|
|
273
269
|
Analyze MCAP file size breakdown by chunks, schemas, channels, and message counts.
|
|
274
270
|
|
|
@@ -276,54 +272,21 @@ Analyze MCAP file size breakdown by chunks, schemas, channels, and message count
|
|
|
276
272
|
pymcap-cli du large.mcap
|
|
277
273
|
```
|
|
278
274
|
|
|
279
|
-
### `list`
|
|
275
|
+
### `list` — List Records
|
|
280
276
|
|
|
281
|
-
List various record types in an MCAP file
|
|
277
|
+
List various record types in an MCAP file.
|
|
282
278
|
|
|
283
279
|
```bash
|
|
284
|
-
# List channels
|
|
285
280
|
pymcap-cli list channels data.mcap
|
|
286
|
-
|
|
287
|
-
# List chunks
|
|
288
281
|
pymcap-cli list chunks data.mcap
|
|
289
|
-
|
|
290
|
-
# List schemas
|
|
291
282
|
pymcap-cli list schemas data.mcap
|
|
292
|
-
|
|
293
|
-
# List attachments
|
|
294
283
|
pymcap-cli list attachments data.mcap
|
|
295
|
-
|
|
296
|
-
# List metadata
|
|
297
284
|
pymcap-cli list metadata data.mcap
|
|
298
285
|
```
|
|
299
286
|
|
|
300
|
-
### `
|
|
301
|
-
|
|
302
|
-
Output comprehensive MCAP file statistics as JSON, including message distribution, channel rates, and compression stats.
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
# Basic JSON output
|
|
306
|
-
pymcap-cli info-json data.mcap
|
|
307
|
-
|
|
308
|
-
# Rebuild from scratch with exact sizes
|
|
309
|
-
pymcap-cli info-json data.mcap --rebuild --exact-sizes
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### `tftree` - TF Transform Tree
|
|
313
|
-
|
|
314
|
-
Display ROS TF transform tree from MCAP files with visual hierarchy.
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
# Show complete TF tree (both /tf and /tf_static)
|
|
318
|
-
pymcap-cli tftree data.mcap
|
|
319
|
-
|
|
320
|
-
# Show only static transforms
|
|
321
|
-
pymcap-cli tftree data.mcap --static-only
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### `video` - Video Generation
|
|
287
|
+
### `video` — Video Generation
|
|
325
288
|
|
|
326
|
-
Generate MP4 videos from image topics
|
|
289
|
+
Generate MP4 videos from image topics using hardware-accelerated encoding. Requires the `video` extra.
|
|
327
290
|
|
|
328
291
|
```bash
|
|
329
292
|
# Basic video generation
|
|
@@ -334,12 +297,9 @@ pymcap-cli video data.mcap --topic /camera/rear --output rear.mp4 --quality high
|
|
|
334
297
|
|
|
335
298
|
# Use specific codec and encoder
|
|
336
299
|
pymcap-cli video data.mcap --topic /lidar/image --output lidar.mp4 --codec h265 --encoder videotoolbox
|
|
337
|
-
|
|
338
|
-
# Manual CRF quality control
|
|
339
|
-
pymcap-cli video data.mcap --topic /camera/debug --output debug.mp4 --crf 18
|
|
340
300
|
```
|
|
341
301
|
|
|
342
|
-
### `roscompress`
|
|
302
|
+
### `roscompress` — ROS Image Compression
|
|
343
303
|
|
|
344
304
|
Compress ROS MCAP files by converting CompressedImage/Image topics to CompressedVideo format. Requires the `video` extra.
|
|
345
305
|
|
|
@@ -347,134 +307,53 @@ Compress ROS MCAP files by converting CompressedImage/Image topics to Compressed
|
|
|
347
307
|
# Basic compression
|
|
348
308
|
pymcap-cli roscompress data.mcap -o compressed.mcap
|
|
349
309
|
|
|
350
|
-
# Specify quality
|
|
351
|
-
pymcap-cli roscompress data.mcap -o compressed.mcap --quality 28
|
|
352
|
-
|
|
353
|
-
# Specify codec
|
|
354
|
-
pymcap-cli roscompress data.mcap -o compressed.mcap --codec h265
|
|
355
|
-
|
|
356
|
-
# Force specific encoder
|
|
357
|
-
pymcap-cli roscompress data.mcap -o compressed.mcap --encoder libx264
|
|
310
|
+
# Specify quality and codec
|
|
311
|
+
pymcap-cli roscompress data.mcap -o compressed.mcap --quality 28 --codec h265
|
|
358
312
|
```
|
|
359
313
|
|
|
360
314
|
### Shell Autocompletion
|
|
361
315
|
|
|
362
|
-
pymcap-cli supports automatic shell completion for bash, zsh, fish, and PowerShell using Typer's built-in completion system.
|
|
363
|
-
|
|
364
|
-
#### Quick Install (recommended)
|
|
365
316
|
```bash
|
|
366
317
|
# Automatically install completion for your current shell
|
|
367
318
|
pymcap-cli --install-completion
|
|
368
319
|
|
|
369
|
-
#
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
```bash
|
|
374
|
-
# Bash - add to ~/.bashrc
|
|
375
|
-
eval "$(pymcap-cli --show-completion bash)"
|
|
376
|
-
|
|
377
|
-
# Zsh - add to ~/.zshrc
|
|
378
|
-
eval "$(pymcap-cli --show-completion zsh)"
|
|
379
|
-
|
|
380
|
-
# Fish - add to ~/.config/fish/config.fish
|
|
381
|
-
pymcap-cli --show-completion fish | source
|
|
382
|
-
|
|
383
|
-
# PowerShell - add to your profile
|
|
384
|
-
Invoke-Expression (& pymcap-cli --show-completion powershell)
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
## Advanced Usage
|
|
388
|
-
|
|
389
|
-
### Performance Optimization
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
# Fast chunk copying (default) - up to 10x faster for large files
|
|
393
|
-
pymcap-cli process data.mcap -o filtered.mcap -y "/camera.*" --chunk-copying
|
|
394
|
-
|
|
395
|
-
# Disable chunk copying for maximum compatibility
|
|
396
|
-
pymcap-cli process data.mcap -o filtered.mcap -y "/camera.*" --no-chunk-copying
|
|
397
|
-
|
|
398
|
-
# Always decode chunks (slower but handles edge cases)
|
|
399
|
-
pymcap-cli process data.mcap -o filtered.mcap -y "/camera.*" --always-decode-chunk
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
### Recovery Modes
|
|
403
|
-
|
|
404
|
-
```bash
|
|
405
|
-
# Graceful error handling (default)
|
|
406
|
-
pymcap-cli process corrupt.mcap -o recovered.mcap --recovery-mode
|
|
407
|
-
|
|
408
|
-
# Strict mode - fail on any errors
|
|
409
|
-
pymcap-cli process data.mcap -o output.mcap --no-recovery
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Time Filtering Options
|
|
413
|
-
|
|
414
|
-
```bash
|
|
415
|
-
# Using seconds (automatically converted to nanoseconds)
|
|
416
|
-
pymcap-cli process data.mcap -o subset.mcap --start-secs 1640995200 --end-secs 1640995260
|
|
417
|
-
|
|
418
|
-
# Using nanoseconds directly
|
|
419
|
-
pymcap-cli process data.mcap -o subset.mcap --start-nsecs 1640995200000000000
|
|
420
|
-
|
|
421
|
-
# Using RFC3339 timestamps (most readable)
|
|
422
|
-
pymcap-cli process data.mcap -o subset.mcap -S "2022-01-01T00:00:00Z" -E "2022-01-01T01:00:00Z"
|
|
320
|
+
# Or manually for a specific shell
|
|
321
|
+
eval "$(pymcap-cli --show-completion bash)" # bash
|
|
322
|
+
eval "$(pymcap-cli --show-completion zsh)" # zsh
|
|
323
|
+
pymcap-cli --show-completion fish | source # fish
|
|
423
324
|
```
|
|
424
325
|
|
|
425
326
|
## Common Use Cases
|
|
426
327
|
|
|
427
|
-
### Clean Up Debug Data
|
|
428
|
-
|
|
429
328
|
```bash
|
|
430
|
-
# Remove debug topics and
|
|
431
|
-
pymcap-cli process
|
|
329
|
+
# Remove debug topics and compress
|
|
330
|
+
pymcap-cli process raw.mcap -o clean.mcap \
|
|
432
331
|
-n "/debug.*" -n "/test.*" --exclude-metadata --compression zstd
|
|
433
|
-
```
|
|
434
332
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
```bash
|
|
438
|
-
# Extract only camera topics with time filtering
|
|
439
|
-
pymcap-cli process full_log.mcap -o camera_only.mcap \
|
|
333
|
+
# Extract camera data with time range
|
|
334
|
+
pymcap-cli process full_log.mcap -o camera.mcap \
|
|
440
335
|
-y "/camera.*" -S "2024-01-01T10:00:00Z" -E "2024-01-01T11:00:00Z"
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
### Recover and Compress
|
|
444
336
|
|
|
445
|
-
```bash
|
|
446
337
|
# Recover corrupt file and compress in one pass
|
|
447
|
-
pymcap-cli process corrupt.mcap -o recovered.mcap
|
|
448
|
-
--recovery-mode --compression lz4
|
|
449
|
-
```
|
|
338
|
+
pymcap-cli process corrupt.mcap -o recovered.mcap --recovery-mode --compression lz4
|
|
450
339
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
```bash
|
|
454
|
-
# Fast filtering with chunk copying for maximum performance
|
|
340
|
+
# Fast filtering with chunk copying (up to 10x faster)
|
|
455
341
|
pymcap-cli process 100gb_file.mcap -o filtered.mcap \
|
|
456
342
|
-y "/lidar.*" --chunk-copying --compression zstd
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
### Optimize for Topic-Specific Playback
|
|
460
343
|
|
|
461
|
-
|
|
462
|
-
# Rechunk by sensor type for faster topic-specific access
|
|
344
|
+
# Optimize for topic-specific playback
|
|
463
345
|
pymcap-cli rechunk robot_log.mcap -o optimized.mcap \
|
|
464
|
-
-p "/camera.*"
|
|
465
|
-
-p "/lidar.*" \
|
|
466
|
-
-p "/imu.*" \
|
|
467
|
-
-p "/gps.*"
|
|
346
|
+
-p "/camera.*" -p "/lidar.*" -p "/imu.*" -p "/gps.*"
|
|
468
347
|
```
|
|
469
348
|
|
|
470
349
|
## Technical Details
|
|
471
350
|
|
|
472
|
-
- **Smart Chunk Processing
|
|
473
|
-
- **MessageIndex Validation
|
|
474
|
-
- **Deferred Schema Writing
|
|
475
|
-
- **Compression Support
|
|
476
|
-
- **Memory Efficient
|
|
477
|
-
- **Error Recovery
|
|
351
|
+
- **Smart Chunk Processing** — automatically chooses between fast chunk copying and individual record processing based on filter criteria
|
|
352
|
+
- **MessageIndex Validation** — validates and rebuilds MessageIndexes when necessary for data integrity
|
|
353
|
+
- **Deferred Schema Writing** — only writes schemas and channels that are actually used by included messages
|
|
354
|
+
- **Compression Support** — zstd, lz4, and uncompressed formats with configurable chunk sizes
|
|
355
|
+
- **Memory Efficient** — streams processing with configurable buffer sizes for handling large files
|
|
356
|
+
- **Error Recovery** — multiple fallback strategies for handling corrupt or incomplete MCAP files
|
|
478
357
|
|
|
479
358
|
## Development
|
|
480
359
|
|