Content moderation with Hive
Add content moderation with Hive into your video platform in a few clicks with AVflow
You need content moderation for your videos to determine if your videos are safe or NSFW (not safe for work). With Hive + AVflow, you can now add content mod into your application in a few minutes!
Read below to manually set this up or clone a similar flow (that uses Hive and Mux) to get started even quicker.
Summary: a video gets uploaded to an S3 bucket which triggers the flow; this video is sent to Hive for analysis. Hive returns a JSON result identifying parts of the video which gets flagged for certain categories (such as nudity, violence, etc) with a probability score. Then AVflow runs a script where you can analyze the JSON results for scores that exceed a threshold and determines the video to be "safe" or "unsafe". This result can then be saved to a Table or sent to the client application via a webhook where the client app can decide, such as, to not to make a streaming URL available to the public.
Here's how to set this up:
1. Add "Hive" as a step to the Flow

2. Setup the step options

Video Source: The source video which will need to be checked before uploading
Classes Filter: The array of tags/labels (aka classes) that need to be checked (["nsfw", "sexual"] ), if not provided this step will return all the tags found/detected in the video. If provided, the result will return the specified tag/labels with the associated scores.
Here's an example:
Note: Need to use double quote for each tag string.
The Hive API Key: The Hive API key associated with the account/project.
3. Add Transfer to Storage step to save the JSON result file to S3 so later steps can process it.
4. Function script: Add a function to read Hive's output JSON to see if there's a label indicating that content is safe or unsafe. You can use our script if you would like or clone it from here:
Input parameters:
Output Parameters:
5. Webhook: Then you can add a webhook back to your client app to decide if you want to make a video private. Here is an example:

6. Tada! Turn the Flow on and check the logs to see the results.