Overview
Create a processing task and launch a worker in a single request.- With the default
source_type: "srt_listener", the endpoint blocks until the worker publishes an SRT URL (typically a few seconds). - With
source_type: "hls_pull", Narrative pulls the supplied HLS manifest and returns immediately. There is no inbound SRT URL, sosrt_urlisnull. - An
hls_pulltask can also be scheduled: passscheduled_start_atand nothing is launched (or billed) right away. The task is stored with statusscheduled, and Narrative starts the worker 15 minutes before that time so it is already pulling the manifest when the stream goes live. See Scheduling an HLS Pull.
Request Parameters
Input Stream Requirements
For SRT listener tasks, stream to the returned URL. For HLS pull tasks, the manifest atsource_url must remain reachable for the task duration. Both inputs must meet these media requirements:
See Video Input Requirements for validation commands and FFmpeg examples.
HLS Start Position
source_start controls where an HLS pull begins. The selected position becomes
time 0 for the task’s transcript, detections, edits, and source archive.
For an EVENT or VOD playlist, offset
0 is normally the beginning of the
event. For a sliding live playlist, offset 0 is the oldest segment still
retained when the worker starts. Use program_date_time when a stable
wall-clock position matters across a sliding DVR window. Requests outside the
retained range fail instead of silently starting at a different point.
Scheduling an HLS Pull
Passscheduled_start_at on an hls_pull request to create the task ahead of the event:
If
scheduled_start_at is less than 15 minutes away, the launch window is already open and the task starts immediately (status queued), exactly like an unscheduled hls_pull request; the response still echoes scheduled_start_at.
If your organization is at its concurrent task limit when the launch time arrives, Narrative retries every few seconds and launches as soon as a slot frees. If no slot frees within 30 minutes of the scheduled start, the task is marked failed with a failure_reason explaining why.
Render Videos Object
When
render_video is set to "ffmpeg", rendered highlight clips are automatically uploaded to a project in your dashboard at app.narrative-sports.com. You can review, download, and manage your clips there. See Dashboard Integration for details.
Team Names Object
For soccer, baseball, and American football, use team names. For MMA and squash singles, use individual competitor names.Example Request
Example Response
HLS Pull Example
{"mode":"live_edge"} instead when only newly published media should be
processed.
The response has the same shape, with srt_url: null:
Response Fields
The generated project ID is available from Get Task Info: call
GET /v1/tasks/{task_id}/info and read task.project_id. The value may be null until the worker has linked the task to a project; retry after the task has started producing project data.
SRT Stream Configuration
URL Format
Thesrt_url includes everything needed to connect:
Connect in SRT caller mode (the default for FFmpeg/OBS) over UDP 9000. SRT latency is negotiated automatically (the server uses 5 seconds); you may also set
&latency=5000000 on your encoder.
SMPTE Timecode
Providesrt_zero_relative_smpte_timecode in HH:MM:SS:FF (non-drop) or HH:MM:SS;FF (drop-frame) format. If framerate is provided, it is used to interpret the timecode. Otherwise, the framerate is inferred from the stream (note: inference can be inconsistent with VFR encoding). Drop-frame timecodes are only valid with 29.97 (30000/1001) or 59.94 (60000/1001) framerates; incompatible combinations cause the task to fail fast.
For OTIO output, srt_zero_relative_smpte_timecode does not by itself shift source_range.start_time.value. Use otio.source_start_offset when you need a fixed frame offset in OTIO.
Task Lifecycle
- scheduled -
hls_pulltask with a futurescheduled_start_at; no worker is running yet and nothing is billed - queued - Task created, worker launching
- running - Worker active (booting or processing)
- ready - SRT URL published, ready to receive stream
- completed - Task finished successfully
- error - Worker failed to launch (infrastructure / instance startup failure)
- failed - Worker started but processing failed (pipeline / runtime error)
- stopping - Graceful stop requested; ingest is stopping while already-submitted renders drain
- stopped - Task was manually stopped via kill (immediate) or after
stoppingdrain completes - cancelled - A
scheduledtask was killed before its worker launched
Error Handling
Rate Limits
Each account has a concurrent task limit. Narrative manages this limit centrally; organization members cannot change it through the API or dashboard. If you have no limit configured, the API returns403:
429:
Worker Launch Failure
If the worker fails to start (e.g., due to high traffic), the API returns a500 error:
Worker Did Not Publish SRT URL in Time
If the worker takes too long to publish the SRT URL, the API returns504:
srt_url from Get Task Info once the worker finishes booting.
