Overview
Video SFW is one of intelligence tasks in the Filestack platform. It allows you to check if your videos contain unsafe content.
Workflows Task Configuration
Video SFW task is available in the Intelligence tasks category in Filestack Workflows. To learn more about how to use the Workflows UI for configuring tasks (and the logic between them), visit Creating Workflows Tutorial.
Workflows Parameters
Task Name | Unique name of the task. It will be included in the webhook response. | |
Details | Indicates if a detailed response should be returned. | |
As file | Indicates if response should be returned as a file. |
Webhook
Here is an example of a webhook that you will receive once your video is processed. details
key is only present when Details parameter set to true
:
{
"id": 88085450,
"action": "fs.workflow",
"timestamp": 1570438682,
"text": {
"workflow": "1401680c-1234-81b4-bae3-04166d1a96ee",
"jobid": "2c22748c-ce65-4979-8071-530b467e4d8b",
"createdAt": "2019-10-07T08:50:15.001357914Z",
"updatedAt": "2019-10-07T08:57:42.180333126Z",
"sources": [
"Yq31nO8kbj6ijRJGvTE"
],
"results": {
"video_sfw_task": {
"data": {
"sfw": false,
"details": {
"unsafe_segments": [
{
"confidence": 93,
"start_offset": 141407,
"end_offset": 145411
},
{
"confidence": 87,
"start_offset": 181407,
"end_offset": 195411
}
]
}
}
}
},
"status": "Finished",
"ttl": 172800
}
}
Because the response can get large for longer videos, you can receive video processing results as a file by setting As file parameter to true
. In this case, webhook will look like this:
{
"id": 88085450,
"action": "fs.workflow",
"timestamp": 1570438682,
"text": {
"workflow": "1401680c-1234-81b4-bae3-04166d1a96ee",
"jobid": "2c22748c-ce65-4979-8071-530b467e4d8b",
"createdAt": "2019-10-07T08:50:15.001357914Z",
"updatedAt": "2019-10-07T08:57:42.180333126Z",
"sources": [
"Yq31nO8kbj6ijRJGvTE"
],
"results": {
"video_sfw_task": {
"url": "https://cdn.filestackcontent.com/YOUR_APIKEY/wf://1401680c-1234-81b4-bae3-04166d1a96ee/2c22748c-ce65-4979-8071-530b467e4d8b/acf95aff157ab3c950f1f71a682b68f5",
"mimetype": "application/json",
"size": 8978
}
},
"status": "Finished",
"ttl": 172800
}
}
Please visit the webhooks documentation page to learn more.
Logic
Video SFW task returns following response to the workflow:{
"data": {
"sfw": false,
"details": {}
}
}
or
{
"data": {
"sfw": true
}
}
Logic Parameters
data | Includes the information of safe for work task. | |
sfw | Indicates whether the file is safe for work or not. | |
details | This element is not useful in workflows logic. |
Based on Video SFW response, you can build logic that tells the workflow how following tasks should be executed. For example, if you would like to delete a file that is not safe for work, you can use Remove Original task with following condition:
sfw eq false
This is how to configure this contidion in Workflows UI:
Visit Creating Workflows Tutorial to learn how you can use Workflows UI to configure your tasks and logic between them.
Video SFW Result
Below you can see how the result file is structured. Boolean value under sfw
key indicates if video content is safe. When sfw
is false
, you can find a list of unsafe segments under unsafe_segments
key. Each item contains a confidence score and a start/end offset (time, in milliseconds from the start of the video, when segment appears).
{
"sfw": false,
"details": {
"unsafe_segments": [
{
"confidence": 75,
"start_offset": 5000,
"end_offset": 7400
},
{
"confidence": 95,
"start_offset": 8800,
"end_offset": 11200
},
{
"confidence": 80,
"start_offset": 11599,
"end_offset": 19999
}
]
}
}