This guide walks you through enabling AI auto-tracking on a live stream. Given a fixed wide-angle source feed that captures the entire field of play, Visionular analyzes each frame in real time, locates the tracked object (e.g., the ball), and produces an auto-framed output stream that mimics a human camera operator following the action — no operator required.
Typical use cases: amateur volleyball/soccer matches, training sessions, and school events where a dedicated camera operator is unavailable.
Before proceeding, ensure you have the following ready:
100504 (Your account has no AI tracking permission). Contact your account manager to have it enabled.requests library (for the code examples below).AI auto-tracking works by cropping a moving "virtual camera" window out of a much wider source frame. The wider and sharper your source, the better the output looks. Use one of the following recommended input resolutions:
| Source Resolution | Aspect Ratio | Typical Scenario | Recommended Output |
|---|---|---|---|
8192x1728 | ≈ 4.74 : 1 (ultra-wide 8K) | Single fixed camera capturing the entire court/pitch with plenty of headroom for the virtual camera to pan. | 1920x1080 |
1920x404 | ≈ 4.75 : 1 (ultra-wide 2K) | Bandwidth-constrained deployments where an 8K ingest is impractical. | 1280x720 |
Frame rate: The source stream must be 30 fps. Other frame rates are not supported by the AI tracking pipeline.
Why these resolutions? Both share the same ultra-wide aspect ratio, which matches the typical side-court fixed camera framing used in volleyball and soccer. Feeding a standard 16:9 source will still work, but the virtual camera has less room to pan, and fast action near the edges may be clipped.
tracking_object | Sport | Framing Logic |
|---|---|---|
volleyball | Volleyball | Tracks the ball; keeps all active players on both sides of the net in the frame when possible. |
soccer | Soccer / Football | Tracks the ball; widens the frame to keep nearby players in view during transitions. |
| Action | HTTP Method | Endpoint | Purpose |
|---|---|---|---|
| 1. Enable on create | POST | /live/v1/live-streams | Configure AI tracking when creating a new live stream. Docs: Create a live stream |
| 2. Update settings | PUT | /live/v1/live-streams/{live_stream_id}/ai-tracking-settings | Change the tracked object or output resolution on an existing stream. Docs: Update AI tracking settings |
| 3. Disable | DELETE | /live/v1/live-streams/{live_stream_id}/ai-tracking-settings | Remove AI tracking from the stream. Docs: Delete AI tracking settings |
⚠️ IMPORTANT: The
PUTandDELETEendpoints above can only be called when the live stream is in theidlestate. To change or disable AI tracking on a running broadcast, stop the stream first, update the configuration, then restart the broadcast.
AI tracking is compatible with most other live-stream features. The only hard conflict is with audio-only mode.
| Feature | Compatible with AI Tracking? | Notes / Error Code |
|---|---|---|
audio_only | ❌ | Returns 100206 at create/update time. |
simulcast_targets | ✅ | Supported — your auto-framed output is pushed to every target. |
watermark_settings | ✅ | Watermark is applied on top of the auto-framed output. |
record / dvr | ✅ | The recorded asset matches the auto-framed output. |
auto_generate_subtitle | ✅ | — |
embedded_closed_captions | ✅ | — |
ai_tracking_setting)| Parameter | Type | Required | Description |
|---|---|---|---|
tracking_object | String | Yes | Sport to track. One of volleyball, soccer. |
target_resolution | String | No | Output resolution. One of 1280x720, 1920x1080. Default: 1280x720. |
import requestsimport jsonurl = "https://api.visionular.com/live/v1/live-streams"payload = {"user_metadata": "volleyball-demo","policy": ["public"],"latency_mode": "standard","reconnect_window": 20,"ai_tracking_setting": {"tracking_object": "volleyball","target_resolution": "1280x720"}}headers = {"Content-Type": "application/json","Authorization": "Basic YOUR_BASE64_AUTH","Auth-Type": "use-basic"}response = requests.post(url, headers=headers, json=payload)print(json.dumps(response.json(), indent=4))
Feed the returned stream_key into an ultra-wide source (e.g., 8192x1728) and you will see the auto-framed 1280x720 output on the returned playback_ids.
Make sure the stream is idle before calling this endpoint.
import requestsimport jsonlive_stream_id = "YOUR_LIVE_STREAM_ID"url = f"https://api.visionular.com/live/v1/live-streams/{live_stream_id}/ai-tracking-settings"payload = {"ai_tracking_setting": {"tracking_object": "soccer","target_resolution": "1920x1080"}}headers = {"Content-Type": "application/json","Authorization": "Basic YOUR_BASE64_AUTH","Auth-Type": "use-basic"}response = requests.put(url, headers=headers, json=payload)print(json.dumps(response.json(), indent=4))
import requestslive_stream_id = "YOUR_LIVE_STREAM_ID"url = f"https://api.visionular.com/live/v1/live-streams/{live_stream_id}/ai-tracking-settings"headers = {"Authorization": "Basic YOUR_BASE64_AUTH","Auth-Type": "use-basic"}response = requests.delete(url, headers=headers)print(response.status_code) # 204 on success
target_resolution to your players' devices. Use 1920x1080 if most viewers watch on desktop/TV; stick with 1280x720 for mobile-first audiences or bandwidth-constrained networks.PUT/DELETE changes for between-match switches avoids the idle-state constraint.record: true if you want a highlight-ready VOD asset of the auto-framed output.| Symptom | Likely Cause | Resolution |
|---|---|---|
100504 — no AI tracking permission | Feature not provisioned on your account. | Contact your account manager. |
100206 — incompatible with audio-only | Request also enabled audio_only. | Remove audio_only from the payload. |
100117 / 100120 — stream active or disabled | PUT / DELETE called on a non-idle stream. | Stop the stream, then retry. |
| Output looks zoomed in / crops action | Source feed is too narrow. | Switch to one of the recommended ultra-wide source resolutions. |
| Output looks soft or jittery | Source bitrate too low or frame rate ≠ 30 fps. | Raise source bitrate, ensure the encoder is set to exactly 30 fps, and use a stable wired connection. |