Fetching Data
Overview
Section titled “Overview”FETCH retrieves historical objects from a track. Unlike SUBSCRIBE (which is a live stream), FETCH returns a bounded set of objects.
Using the CLI
Section titled “Using the CLI”# Fetch data from a track (latest group)moqtap peek moqt://relay.example.com data live video
# Fetch only the latest objectmoqtap peek moqt://relay.example.com data live video latest
# JSON outputmoqtap peek moqt://relay.example.com data live video -j
# Raw payload (pipe to file or another tool)moqtap peek moqt://relay.example.com data live video --raw > output.binThe peek data command reads the catalog track to understand available content, then subscribes or fetches sample data with auto-detected payload format.
The FETCH lifecycle
Section titled “The FETCH lifecycle”FETCH (sent) → OK (received) → objects on fetch stream → stream closesFETCH (sent) → error (received)| Drafts | Success | Error | To cancel |
|---|---|---|---|
| 07–14 | FETCH_OK | FETCH_ERROR | FETCH_CANCEL |
| 15–16 | FETCH_OK | REQUEST_ERROR | FETCH_CANCEL |
| 17–22 | FETCH_OK | REQUEST_ERROR | Close the FETCH’s request stream |
| 23 | REQUEST_OK | REQUEST_ERROR | Close the FETCH’s request stream |
In draft-23 a FETCH whose Location Filter is relative is rejected with INVALID_RANGE; give it an absolute range.
Viewing fetched objects
Section titled “Viewing fetched objects”Fetched objects arrive on a dedicated unidirectional stream (fetch stream type 0x05 in drafts 07–23). moqtap displays them in order with their group/object IDs and payload content.