This guide shows you how to set up a live stream with content moderation to automatically detect and flag inappropriate content in real-time.
Content Moderation is a powerful feature that analyzes video frames from your live stream in real-time to detect potentially inappropriate content. When the system detects content that exceeds your configured confidence thresholds, it sends an event notification to your webhook endpoint, allowing you to take immediate action.
| Model | Description |
|---|---|
nude | Detects nudity and adult content |
weapon | Detects weapons and dangerous objects |
audit_check event is sent to your webhook endpoint with details about the detected content.Before you begin, ensure you have:
To create a live stream with content moderation enabled, include the audit_settings parameter in your request:
Request:
curl -X POST https://api.visionular.com/live/v1/live-streams \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-H "Content-Type: application/json" \-d '{"user_metadata": "Content Moderation Demo","latency_mode": "low","audit_settings": {"frame_interval": 1,"models": {"nude": 0.6,"weapon": 0.8}}}'
Parameters:
| Parameter | Type | Description |
|---|---|---|
audit_settings | object | Content moderation configuration |
audit_settings.frame_interval | integer | Interval in seconds between frame captures for analysis. Minimum value: 1 |
audit_settings.models | object | Detection models and their confidence thresholds |
audit_settings.models.nude | number | Confidence threshold (0.0-1.0) for nudity detection. Lower values are more sensitive. |
audit_settings.models.weapon | number | Confidence threshold (0.0-1.0) for weapon detection. Lower values are more sensitive. |
Response:
{"code": 0,"data": {"stream_key": "202601-e95e9a27-e904-4340-9186-c27310dd729c","status": "idle","id": "202601-MjNkZWY5NmVhY2M3OTZmODAwZjIxNzI3ZGIzMGI2ZDE","user_metadata": "Content Moderation Demo","audit_settings": {"frame_interval": 1,"models": {"nude": 0.6,"weapon": 0.8}}},"message": "success"}
You can update the content moderation settings for an existing live stream:
Request:
curl -X PUT https://api.visionular.com/live/v1/live-streams/{live_stream_id}/audit-settings \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-H "Content-Type: application/json" \-d '{"audit_settings": {"frame_interval": 5,"models": {"nude": 0.8,"weapon": 0.9}}}'
Response:
{"code": 0,"data": {"live_stream_id": "202601-MjNkZWY5NmVhY2M3OTZmODAwZjIxNzI3ZGIzMGI2ZDE","audit_settings": {"frame_interval": 5,"models": {"nude": 0.8,"weapon": 0.9}}},"message": "success"}
To disable content moderation for a live stream, delete its audit settings:
curl -X DELETE https://api.visionular.com/live/v1/live-streams/{live_stream_id}/audit-settings \-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response: 204 No Content
To stop the content moderation task for an active streaming session:
Request:
curl -X POST https://api.visionular.com/audit/v1/tasks/stop-audit-task \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-H "Content-Type: application/json" \-d '{"stream_session_id": "MjNxMmM0NnctMjAyNTEwLWQ0OWM4NDA5LWJjNzYtNGU4Mi1iOTJmLTg5YzVhOTQzMGRjNC0xNzYyMTU1MjU5"}'
Response:
{"code": 0,"message": "stop audit task success"}
Retrieve the list of content moderation records:
Request:
curl -X GET "https://api.visionular.com/audit/v1/records/moderation-records?page=1&limit=10&stream_session_id={SESSION_ID}&alert_type=nude" \-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number |
limit | integer | No | Number of items per page (default: 25) |
stream_session_id | string | No | Filter by streaming session ID |
alert_type | string | No | Filter by alert type: nude or weapon |
Response:
{"request_id": "bba7828e-3ac9-4f6a-adae-71dd18991a4f","code": 0,"message": "get audit records success","data": [{"id": 581,"task_id": 35,"event_id": "0000019a9c0d4afd-14d26dc5-00000014-e4f4ee94","account_id": "1200","channel_id": "bjJoMjQzcTctMjAyNTExLWVlNTA0OTE1LTRlZmYtNDdhMi1iNWE4LWMzODZlMmQ1MzdjMS0xNzYzNTU0NDk0","url": "https://audit-test.visionular.com/...","detect_info": "[{\"model\": \"nude\", \"confidence\": 0.32, \"risk_level\": \"pass\", \"bounding_box\": [0, 0, 0, 0]}]","detect_status": 1,"audit_from": 1,"review_at": 1763554708917,"created_at": 1763554725}]}
Record Fields:
| Field | Type | Description |
|---|---|---|
id | integer | Record ID |
task_id | integer | Task ID |
event_id | string | Event ID |
channel_id | string | Stream session ID |
url | string | Signed URL to the captured frame image |
detect_info | string | JSON string with detection details (model, confidence, risk_level, bounding_box) |
detect_status | integer | Detection status |
created_at | integer | Record creation timestamp (Unix) |
The confidence threshold determines how sensitive the detection should be:
| Threshold Range | Sensitivity | Use Case |
|---|---|---|
| 0.3 - 0.5 | High | Strict moderation, may have more false positives |
| 0.5 - 0.7 | Medium | Balanced moderation, recommended for most use cases |
| 0.7 - 0.9 | Low | Lenient moderation, only flags high-confidence detections |
When content is detected that exceeds your threshold, AuroraLive sends an audit_check event to your configured webhook endpoint.
{"type": "audit_check","id": "0000019a48a474e8-0aaf4f34-0000000f-e14056d5","data": {"stream_info": {"stream_id": "202510-M2Y1NzBjMjVmZDI5NmJmNGYxNDliMjEyNmJiZTA0YWE","stream_session_id": "MjNxMmM0NnctMjAyNTEwLWQ0OWM4NDA5LWJjNzYtNGU4Mi1iOTJmLTg5YzVhOTQzMGRjNC0xNzYyMTU1MjU5","title": "demo","start_time": 1762155261},"frame_url": "https://audit-test.visionular.com/...","alerts": [{"type": "nude","confidence": 0.68,"description": "Nudity detected in the frame","detection_info": {"model": "nude","confidence": 0.68,"bounding_box": [0, 0, 0, 0],"risk_level": "reject"}}]},"created_at": "2025-11-03T07:35:29Z"}
| Risk Level | Description | Recommended Action |
|---|---|---|
pass | Content is acceptable | No action needed |
review | Content may be inappropriate | Flag for manual review |
reject | Content is inappropriate | Immediately disable stream or take action |
Set Appropriate Thresholds: Start with medium thresholds (0.5-0.7) and adjust based on your content and false positive rates.
Configure Event Notifications: Ensure your webhook endpoint is properly configured before enabling content moderation.
Implement Automated Actions: For high-risk content (reject level), consider automatically disabling the stream using the Disable Live Stream API.
Review Flagged Content: For review level alerts, implement a manual review workflow to verify detections before taking action.
Frame Interval Optimization:
frame_interval: 1 for high-risk content (adult, gambling)frame_interval: 2-5 for general moderation to reduce costs