Video Moderation
Stream's video moderation engine samples frames from an uploaded video and scores each frame with the same AI categories you use for images. The video takes the strictest frame verdict. It can also read the text shown on screen and transcribe what is said. Analysis runs asynchronously so the upload is not held back.
Results are returned as ai_video. Existing video rules, the review queue, webhooks, and billing keep working.
How it works
When a video is uploaded:
- The video is accepted immediately.
- Stream samples frames evenly across the whole video (default one frame per second). If the video is long, the sample rate is thinned so the full video is still covered.
- Each frame is scored against your video policy rules (the same label and confidence model as image moderation). With OCR rules, the text on each frame is also read and classified. With an audio config, the audio track is transcribed and classified at the same time.
- The video action is the strictest action across frames, on-screen text, and speech. Their labels are combined.
- The message or post is updated when analysis finishes.
- Flagged videos appear in the content review queue. Open Moderation > Review Queue in the dashboard.
You can change how densely frames are sampled in the dashboard video policy.
Supported categories
These are the categories shown in the dashboard video policy editor. Video uses the image moderation categories, without PII and QR Code, and has no subcategories:
- Explicit
- Non-Explicit Nudity of Intimate parts and Kissing
- Swimwear or Underwear
- Violence
- Visually Disturbing
- Drugs & Tobacco
- Alcohol
- Rude Gestures
- Gambling
- Hate Symbols
Set a confidence threshold per category (1 to 100). Higher values flag less. A threshold of 90 only matches highly confident frames, which means fewer flags and fewer false positives.
Supported formats
Video moderation accepts most common video containers and codecs, including:
- MP4 (
.mp4,.m4v) - QuickTime (
.mov), including iPhone recordings in HEVC (H.265) and HDR - WebM (
.webm) - Matroska (
.mkv) - AVI (
.avi) - MPEG (
.mpg,.mpeg,.ts) - 3GP (
.3gp) - FLV (
.flv) - WMV (
.wmv)
Supported video codecs include H.264, H.265 (HEVC), VP8, VP9, AV1, MPEG-2, MPEG-4 Part 2, and ProRes.
The format is detected from the file contents, not the extension. The file must include duration metadata. Videos without it are not moderated. To keep unsupported uploads out entirely in Stream Chat, configure the app's file upload allowlist or blocklist from the dashboard. This is a Stream Chat upload setting, not part of the Moderation API; for standalone moderation, filter file types in your own upload flow.
Configuration
Set an action for each category you care about on ai_video_config, with a required min_confidence on a 0-100 scale, the same shape as image rules. Video and image are set separately in the policy, so video settings don't affect image moderation. Live calls use video_call_rule_config, not this field.
await client.moderation.upsertConfig({
key: "chat:messaging",
ai_video_config: {
rules: [
{ label: "Explicit", action: "remove", min_confidence: 70 },
{ label: "Violence", action: "flag", min_confidence: 50 },
],
},
});Actions are flag, shadow, remove, bounce, bounce_flag, and bounce_remove. Use flag for borderline frames and remove for content that should not stay up.
Send video URLs in moderation_payload.videos with the Check API. Stream Chat and Feeds send attached videos for you.
const response = await client.moderation.check({
entity_type: "listing",
entity_id: "listing-123",
entity_creator_id: "user-42",
config_key: "marketplace",
moderation_payload: {
videos: ["https://cdn.example.com/listings/123/tour.mp4"],
},
});
// response.status is "pending" until the video is analyzedText on screen
To moderate text shown in the video, such as a phone number or a link on screen, add ocr_rules to ai_video_config. Each sampled frame goes through the same text extraction as image OCR, and the text is classified with your policy's text engine: AI Text (NLP) labels, or your AI Text (LLM) labels. ocr_severity_rules sets an action per severity, as it does for images.
await client.moderation.upsertConfig({
key: "chat:messaging",
ai_video_config: {
rules: [{ label: "Explicit", action: "remove", min_confidence: 70 }],
ocr_rules: [{ label: "THREAT", action: "flag" }],
},
});- Text found on screen counts toward the video's
ai_videoresult, like a frame label. Theocr_contentrule condition matches it too. - Depending on your app's image engine, text extraction may only run alongside frame rules. If OCR rules alone return no results, add at least one frame rule to
rules.
Speech in the video
To moderate what is said in a video, add audio_config to ai_video_config. It has the same shape as the policy's audio configuration: NLP rules in ai_text_config, LLM rules in llm_config, and it follows the policy's text engine the same way. Stream extracts the audio track, transcribes it with the same service and languages as audio moderation, and classifies the transcript while the frames are scored.
await client.moderation.upsertConfig({
key: "chat:messaging",
ai_video_config: {
rules: [{ label: "Explicit", action: "remove", min_confidence: 70 }],
audio_config: {
ai_text_config: {
rules: [{ label: "THREAT", action: "flag" }],
},
},
},
});- The speech verdict is part of the video's
ai_videoresult: the video takes the strictest action across frames and speech, and the speech labels join the video's labels. There is no separate audio flag, so a voice note on the same message keeps its ownai_audioflag. - The transcript is stored on the review item in
moderation_payload.custom.video_transcripts, one entry per video in the order ofmoderation_payload.videos(an empty string for a video without speech). - A policy with only
audio_configmoderates the speech alone, without sampling frames. - A video without an audio track is moderated on its frames alone. If the speech can't be transcribed, the frame verdict still stands.
ai_audio_configcovers audio attachments andai_video_config.audio_configcovers the sound in videos. Set each one separately.- Saving
ai_video_configwithoutaudio_configkeeps the stored audio config. Send"audio_config": nullto remove it. - Each video whose speech is classified also counts as one text moderation request.
- Speech labels join the video's labels, so the
video_contentrule condition matches them like frame labels.ocr_contentmatches only text on screen.
In the review queue
In the content review queue, each label on a video shows where it came from: frame labels as they are, (OCR) for text on screen, and (Audio) for speech. Selecting a label filters the queue by it. The item view shows each video's transcript under the video.
In the dashboard, set these up in the AI: Videos (OCR) and AI: Videos (audio) sections of a policy.
Limitations
- Analysis is always asynchronous. The verdict arrives a few seconds to a few minutes after the request, depending on length. The
asyncfield onai_video_configis ignored for video, andforce_syncon Check skips video entirely, so don't use either to wait for a verdict. - Videos longer than 5 minutes or larger than 100 MB are not moderated, neither the frames nor the speech. Within that limit, longer videos are sampled more sparsely so the whole file is still covered.
Hold a video until it's checked
Stream Chat and Feeds publish the video right away and update the message or post if it is flagged or removed. To keep a video hidden until it's confirmed safe in your own app:
- Store the video as pending and don't show it to other users.
- Call Check with the video. The response has
status: "pending". - Handle the
moderation_check.completedwebhook. It carriesentity_id,entity_type, andrecommended_action. - Publish the video when
recommended_actioniskeep, and remove or hold it for review otherwise.