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.
Using the desktop app
Section titled “Using the desktop app”- Enter the namespace and track name
- Specify the range (start group/object to end group/object)
- Click Fetch
The FETCH lifecycle
Section titled “The FETCH lifecycle”FETCH (sent) → FETCH_OK (received) → objects on fetch stream → stream closesor:
FETCH (sent) → FETCH_ERROR (received) # draft-14FETCH (sent) → REQUEST_ERROR (received) # draft-17Viewing fetched objects
Section titled “Viewing fetched objects”Fetched objects arrive on a dedicated unidirectional stream (fetch stream type 0x05 in draft-17). moqtap displays them in order with their group/object IDs and payload content.
Cancelling a FETCH
Section titled “Cancelling a FETCH”In draft-14, send FETCH_CANCEL to abort an in-progress fetch. In draft-17, the consolidated request pattern handles cancellation.